Aug 7 - Update new design as default

This commit is contained in:
2026-08-07 11:24:22 -04:00
parent b12c019810
commit 16d5e8a6fa
6 changed files with 101 additions and 9 deletions
@@ -0,0 +1,57 @@
"""phase50 — make the modern design the default
phase48 shipped the modern design as an opt-in A/B test: `users.ui_theme`
defaulted to 'classic' and users switched themselves over. The test is settled,
so this promotes 'modern' to the default.
Two separate things have to change, and BOTH are needed:
1. The column default, so NEW accounts start on modern.
2. The existing rows. Every account created under phase48 has a literal
'classic' stored — not a NULL — so a default change alone would leave every
current user on the old design and the switch would look like it did nothing.
**This overwrites a deliberate choice.** phase48 gave no way to distinguish "I
picked classic" from "I never touched it", so anyone who actively preferred
classic is moved too. They can switch straight back from the account menu, and
that choice will then stick — nothing here removes the switcher.
`/ui/theme-votes` reads this same column, so the A/B tally reads 100% modern
once this runs. Capture it before deploying if the numbers still matter.
To change the default WITHOUT touching saved preferences, set
DEFAULT_UI_THEME=classic in the environment instead of running this.
"""
revision = 'phase50_default_modern'
down_revision = 'phase49_external_inspector'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
# 1. New accounts start on modern.
op.execute(sa.text(
"ALTER TABLE users MODIFY COLUMN ui_theme VARCHAR(16) "
"NOT NULL DEFAULT 'modern'"
))
# 2. Move everyone still on the phase48 default. Idempotent: re-running
# matches nothing once every row is 'modern'.
op.execute(sa.text(
"UPDATE users SET ui_theme = 'modern' WHERE ui_theme = 'classic'"
))
def downgrade():
op.execute(sa.text(
"ALTER TABLE users MODIFY COLUMN ui_theme VARCHAR(16) "
"NOT NULL DEFAULT 'classic'"
))
# Individual pre-upgrade choices were not recorded, so this returns
# EVERYONE to classic rather than restoring who had what.
op.execute(sa.text(
"UPDATE users SET ui_theme = 'classic' WHERE ui_theme = 'modern'"
))