Skip to content

🤖 fix: make settings titlebar control toggle open/close#2429

Merged
ibetitsmike merged 3 commits intomainfrom
mike/settings-button-close-toggle
Feb 14, 2026
Merged

🤖 fix: make settings titlebar control toggle open/close#2429
ibetitsmike merged 3 commits intomainfrom
mike/settings-button-close-toggle

Conversation

@ibetitsmike
Copy link
Contributor

@ibetitsmike ibetitsmike commented Feb 14, 2026

Summary

When the settings route is active, the titlebar settings control now changes from a cog to an X and behaves as a close action.

Background

Users expect the same top-level control used to open settings to also close settings, instead of requiring a separate close button in the page content.

Implementation

  • Updated SettingsButton to read isOpen from useSettings().
  • When closed, button keeps existing behavior (cog icon + open action).
  • When open, button renders an X icon and calls close(), which returns to the previous route via existing router logic.
  • Updated button tooltip/aria label so assistive and hover copy match the active action.
  • Added SettingsButton.test.tsx to verify open -> settings route -> close -> previous route behavior.
  • Hardened SettingsButton.test.tsx cleanup so it no longer tears down shared global DOM between test files.
  • Updated tests/e2e/scenarios/settings.spec.ts to target data-testid="settings-button" for close-mode assertions/clicks so the scenario stays stable with the new toggle behavior.

Validation

  • bun test src/browser/components/SettingsButton.test.tsx
  • make test-e2e PLAYWRIGHT_ARGS='tests/e2e/scenarios/settings.spec.ts'
  • bun test src/browser/components/SettingsButton.test.tsx src/browser/components/AppLoader.auth.test.tsx
  • make static-check

Risks

Low risk and scoped to settings chrome + related tests. Existing route/page close controls remain unchanged.


Generated with mux • Model: openai:gpt-5.3-codex • Thinking: xhigh • Cost: $0.01

Summary:
- Switch `SettingsButton` to route-aware toggle behavior.
- Show cog/open affordance off settings routes and X/close affordance on settings routes.
- Added regression test covering open->close route restoration behavior.

---

_Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.01`_

<!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.01 -->
Summary:
- Updated `settings.spec.ts` to assert the titlebar settings toggle (`data-testid=settings-button`) enters close mode.
- Replaced ambiguous `/close settings/i` role locator with the settings toggle test id in the close-settings test.
- Keeps the e2e scenario aligned with the new cog->X toggle behavior.

---

_Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.01`_

<!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.01 -->
Summary:
- Avoids setting global `window`/`document` to `undefined` in `SettingsButton.test.tsx` cleanup.
- Adds a safe fallback `GlobalWindow` only when no DOM globals are present.
- Keeps route-restore assertion stable by comparing to the captured initial pathname.

---

_Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.01`_

<!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.01 -->
@ibetitsmike ibetitsmike merged commit 62deee1 into main Feb 14, 2026
23 checks passed
@ibetitsmike ibetitsmike deleted the mike/settings-button-close-toggle branch February 14, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant