refactor: apply code quality suggestions from task-6-mobile-fab review

Three suggestions from the code review applied:

1. Extract _createSessionInput() factory to eliminate five-line
   duplication between showNewSessionInput and showFabSessionInput.
   Both functions now call the shared factory. Updated 4 existing
   tests to check _createSessionInput's body; added 7 new tests
   covering factory behavior and factory usage in each consumer.

2. Fix .new-session-fab:focus-visible outline color from var(--accent)
   to var(--bg) — the FAB background is already var(--accent), so
   using the same color for the outline created zero contrast.
   Added 1 new test to guard this going forward.

3. Add early-return guard in showFabSessionInput against duplicate
   overlays: if (document.querySelector('.fab-input-overlay')) return;
   Prevents a second overlay being created if called programmatically
   while one is already open. Added 1 new test.

532 tests pass (9 new tests added, 523 unchanged).
This commit is contained in:
Brian Krabach
2026-03-30 02:00:22 -07:00
parent 9978544dc1
commit 5b971a0ecc
4 changed files with 166 additions and 24 deletions
+1 -1
View File
@@ -1234,7 +1234,7 @@ body {
}
.new-session-fab:focus-visible {
outline: 2px solid var(--accent);
outline: 2px solid var(--bg);
outline-offset: 2px;
}