Skip to content

Swap the home screen model button for a dark/light mode switch - #131

Merged
horner merged 5 commits into
mainfrom
feat/theme-toggle
Jul 27, 2026
Merged

Swap the home screen model button for a dark/light mode switch#131
horner merged 5 commits into
mainfrom
feat/theme-toggle

Conversation

@morepriyam

@morepriyam morepriyam commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

What

Replaces the "Model" button on the home screen header with a dark/light mode switch, and moves model switching into the caption editor where the rest of the captioning flow already lives.

Why

The home screen header used a "Model" button to open the on-device AI model picker, but that picker is really a captioning concern — it belongs with the caption editor, not the drafts list. This also frees up the header for a more universally useful control: a manual appearance toggle.

Changes

  • Home screen (src/app/index.tsx): removed the "Model" button and its model-picker wiring. Added a dark/light mode switch (sun/moon icon + label) in its place.
  • Theme persistence (src/db/settings.ts, src/hooks/use-theme.ts): added a persisted theme preference. useTheme() now uses the manual override when set, otherwise falls back to the OS color scheme — same return shape, so no other screen needed changes. New useThemeToggle() hook drives the switch.
  • Icons (src/components/icon.tsx): added sun.max.fill / moon.fill Android glyph mappings to match the SF Symbols used on iOS.
  • Caption editor (src/app/subtitles.tsx): added a model-switcher button next to Undo/Redo (tinted accent when a model is active), wired to the existing model picker modal. This is now the only in-app place to change the selected model; the export screen's "no model yet" prompt is unchanged.

Testing

  • tsc --noEmit: no errors
  • expo lint: no new warnings
  • jest: full suite passes (119 passed, matching baseline)

Fixes #130

Screenshots

Home header — appearance switch replaces the model button

Before (main) After — light After — dark
Home header before — model button Home header after — appearance switch, light Home header after — appearance switch, dark

Caption editor — the model switcher's new home

After
Caption editor header with model switcher button

Live demo — theme flip + model switcher in the caption editor

ScreenRecording_07-26-2026.14-16-39_1.MP4

The Model button on the home screen header now toggles the app's
appearance instead of opening the on-device AI model picker. The
manual light/dark choice is persisted (falling back to the OS scheme
until the user picks one) via a new theme preference in settings.

Model switching moves to the caption editor (subtitles screen), next
to Undo/Redo, so it lives alongside the rest of the captioning flow
where the export screen already surfaces it for first-time selection.

Fixes #130
Copilot AI review requested due to automatic review settings July 26, 2026 00:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Pulse’s UI/UX around two global concerns: appearance and on-device caption model selection. It replaces the home screen’s model picker entry point with a persisted light/dark toggle, and relocates model switching into the caption editor where captioning actions live.

Changes:

  • Replaced the home header “Model” affordance with a dark/light appearance switch (icon + label).
  • Added persisted theme preference support and a new useThemeToggle() hook while keeping useTheme()’s return shape stable.
  • Moved the model-switcher entry point into the caption editor header and added Android glyph mappings for the new sun/moon icons.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/hooks/use-theme.ts Adds persisted theme override resolution and exposes useThemeToggle() for the new header switch.
src/db/settings.ts Persists a new appearance.theme setting and exposes query/set helpers.
src/components/icon.tsx Maps sun.max.fill / moon.fill to Android Lucide icons.
src/app/subtitles.tsx Adds a model-switcher header button and wires it to ModelSwitcherModal.
src/app/index.tsx Removes model picker from home header and adds the appearance switch UI/accessibility wiring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/hooks/use-theme.ts Outdated
@morepriyam
morepriyam requested a review from horner July 26, 2026 00:39
useTheme() previously called useLiveQuery() directly, so every leaf
component that renders themed content (ThemedText, ThemedView, cue
rows, etc.) opened its own Drizzle live-query subscription. Move the
live query into a ThemeProvider mounted once near the app root and
have useTheme()/useThemeToggle() read the resolved scheme from
context instead.
Copilot AI review requested due to automatic review settings July 26, 2026 00:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread src/app/_layout.tsx Outdated
…nav theme

ThemeProvider live-queries the settings table, which doesn't exist on
a fresh install until MigrationGate applies drizzle/0003 — so it now
mounts INSIDE the gate. The gate's pre-migration loading/error UI can
still render ThemedView/ThemedText: outside the provider, useTheme()
falls back to the OS scheme (the stored preference is unreadable
before the DB exists anyway) instead of touching the DB.

Also derive the expo-router navigation theme and the status bar style
from the RESOLVED scheme (manual override, else OS) via the new
useThemeMode(), so they can't drift from the app's own colors once
the user flips the appearance switch.
Copilot AI review requested due to automatic review settings July 26, 2026 17:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread src/app/subtitles.tsx
…r button

The model-switcher moved from the home header (where its button
announced hint + selected state + the active model's label) into the
caption editor, but HeaderBtn only exposed a static label — dropping
that state from screen readers at the only remaining in-app switch
point. HeaderBtn now takes optional hint/selected/valueText a11y
props and the model button restores the old semantics: hint 'Choose
the model used for captions', selected when a model is active, value
= the model's label or 'Off'.
Copilot AI review requested due to automatic review settings July 26, 2026 17:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread src/app/subtitles.tsx Outdated
Passing selected: undefined for every header button (Undo/Redo) can
be coerced falsy and read as an unnecessary 'not selected' by screen
readers — only include the key when a caller actually provides it.
Copilot AI review requested due to automatic review settings July 26, 2026 17:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@morepriyam
morepriyam enabled auto-merge July 26, 2026 18:55

@horner horner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@morepriyam
morepriyam added this pull request to the merge queue Jul 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to Branch Protection failures Jul 26, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.
@morepriyam
morepriyam added this pull request to the merge queue Jul 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to Branch Protection failures Jul 27, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.
@kadenhorner kadenhorner moved this from Ready to In Progress in Scrum Team Jerry Jul 27, 2026
@horner
horner added this pull request to the merge queue Jul 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to Branch Protection failures Jul 27, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.
@horner
horner added this pull request to the merge queue Jul 27, 2026
Merged via the queue into main with commit a5180b5 Jul 27, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Scrum Team Jerry Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Replace the home screen "Model" button with a dark/light mode switch

4 participants