Skip to content

refactor: every settings page speaks refresh, entered and close - #2184

Merged
yw0nam merged 5 commits into
mainfrom
refactor/2142-lifecycle
Nov 30, 2026
Merged

yw0nam merged 5 commits into
mainfrom
refactor/2142-lifecycle

Conversation

@yw0nam

@yw0nam yw0nam commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Summary

The third #2142 follow-up: every settings page speaks one lifecycle.

PageView (page-view.tsx)   refresh?()  reads the stored values when the window opens
                           entered?()  its tab shows
                           close?()    lands (commits) unsaved input and stops running work: the window closed
renames   together, persona  reflect → refresh · perms  loadMonitorsIfEnabled → refresh · connection, voice  commit → inside close
panel     open: the refreshes in today's order, the selected tab's entered(), the voice list, perms refresh() last
          close and dispose: closePages() = listening, connection, voice, motion — before root.unmount() in dispose
  • A new close order, on purpose. Before: close ran listening.close, connection.commit, voice.commit, connection.close, motion.close, voice.close; dispose skipped connection.close and motion.close and stopped the audition after unmount. Now both run listening → connection (commit, its close, guided closed) → voice (commit, audition stop) → motion. The pages are independent; every draft write still happens before unmount.
  • Dispose now ends an active mouth preview (motion's close; its previewing flag releases once) and runs connection's close while its child handles exist. A second close after Escape does nothing visible: drafts are deleted before they are written, aborts and stops are idempotent.
  • Connection's focus methods stay its own. The Persona controller is personaPage, so the rule's call pattern covers every controller.
  • Concept rule page-lifecycle: owner page-view.tsx:PageView (marker); patterns: a legacy member (commit / reflect / loadMonitorsIfEnabled) declared in a *-page.ts, and a panel call of one on a …Page controller; child calls such as stt.current?.commit() pass.

Related issues

Part of #2142

Related decisions / docs

Owner decision on #2142 (latest comment): refresh / entered / close with fixed meanings; Together's reflect becomes refresh; Connection's focus methods stay.

Runtime evidence (required for UI / DOM / runtime behavior)

N/A beyond the panel's unit suites — the visible change is that closing the settings window while a mouth preview runs now ends it; pinned by the new test. pnpm vitest run --project unit src/ui/quick-controls src/app/settings-window: 80 files, 1037 tests pass; the open-order tests are unchanged except the renamed labels.

Merge danger

  • Door: two-way.
  • Blast radius: the settings window's open, close and teardown.

Tests

  • New, red first: "disposing the panel while a preview is active calls onGainPreviewEnd" (qc-gain-row.test.tsx; red-run: expected called once, got 0 times).
  • qc-voice-server.test.tsx "%s lands a typed TTS field and a typed TTS key" over the panel's teardown and Escape: the Escape row passed before the change (onClose already committed), so it guards folding commit into close. Mutation proof (testing.md rule 8): removing handle.current?.commit(); from voice-page.ts close() fails both rows with expected '' to be 'http://127.0.0.1:8088'.
  • Renamed only: the open-order fixture labels (order unchanged), perms-page.test.tsx, together-page.test.tsx, connection-page.detail.test.ts:115 ("close() lands dirty key and endpoint inputs…"), and three titles that said "open hook".

Verification

  • pnpm build passes (includes tsc typecheck)
  • pnpm test passes
  • pnpm lint passes (biome format + lint)
  • cargo test / cargo clippy pass (Rust changes) — none
  • Runtime evidence attached above, or N/A justified

pnpm gates once at e9afd786 with CONCEPT_RULES_CHANGE_OK=1 (this PR adds a rule): every gate exit 0. Two independent reviews (spec: double close, order, regexes; standards): approve; their fixes are in 85aec36a and e9afd786.

Checklist (YUI principles)

  • Schema changes update docs/reference/client-context.md alongside the code (none)
  • docs/agent-guide/architecture/map.js carries every module, part, and exchange this PR adds, removes, or changes (none changed)
  • No unverified assumptions
  • No brain in the client
  • No inline control tags
  • No hardcoding
  • New/changed behavior ships a test in this PR

A page's close commits its unsaved input and stops its running work, and the panel runs one close sequence on Escape and on dispose, so dispose now ends an active mouth preview. Together's and Persona's reflect and Permissions' loadMonitorsIfEnabled become refresh; Connection's and Voice's commit folds into close.
@yw0nam yw0nam added the rule-change A PR that deliberately changes a rule test (rule-tests.sh) or a concept rule (concept-rules.json) label Nov 30, 2026
@yw0nam
yw0nam merged commit 855cb2c into main Nov 30, 2026
12 checks passed
@yw0nam
yw0nam deleted the refactor/2142-lifecycle branch November 30, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule-change A PR that deliberately changes a rule test (rule-tests.sh) or a concept rule (concept-rules.json)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant