[feat](trx-frontend-http): mark Tools active for its destinations #34

Merged
sjg merged 1 commits from feat/tools-active-state into main 2026-08-03 00:24:04 +02:00
Owner

Second of the three follow-ups.

The gap

Grouping Statistics, Recorder, Settings and About behind Tools left the strip looking identical on all four. The destination's own button does get the active class — but the strip hides that button, so nothing was marked. The page titles I added name the page without saying how you got there.

The fix

Mark the Tools button when the active destination is one the strip hides.

The condition is read from the button's computed display, not from a second copy of the grouping:

toolsBtn.classList.toggle("active", getComputedStyle(btn).display === "none");

So the two cannot drift. Whatever ui-core puts in the menu lights up Tools, and a destination promoted back into the strip stops doing so with no further change — including the responsive case, where the set could differ by width.

Tools already carries the tab class, so the existing active styling applies unchanged: same red underline and colour as any other selected tab.

Verified

on Radio        tools=false  radio=true
on statistics   tools=true   radio=false
on settings     tools=true   radio=false
on Map          tools=false  radio=false

Full gate green — typecheck, lint, 34/34 test, build, test:browser.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GdyUjuXejCEfiub675z6cz

Second of the three follow-ups. ## The gap Grouping Statistics, Recorder, Settings and About behind **Tools** left the strip looking identical on all four. The destination's own button does get the active class — but the strip hides that button, so nothing was marked. The page titles I added name the page without saying how you got there. ## The fix Mark the Tools button when the active destination is one the strip hides. The condition is read from the button's **computed display**, not from a second copy of the grouping: ```ts toolsBtn.classList.toggle("active", getComputedStyle(btn).display === "none"); ``` So the two cannot drift. Whatever `ui-core` puts in the menu lights up Tools, and a destination promoted back into the strip stops doing so with no further change — including the responsive case, where the set could differ by width. Tools already carries the `tab` class, so the existing active styling applies unchanged: same red underline and colour as any other selected tab. ## Verified ``` on Radio tools=false radio=true on statistics tools=true radio=false on settings tools=true radio=false on Map tools=false radio=false ``` Full gate green — `typecheck`, `lint`, 34/34 `test`, `build`, `test:browser`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01GdyUjuXejCEfiub675z6cz
sjg added 1 commit 2026-08-03 00:23:18 +02:00
[feat](trx-frontend-http): mark Tools active for its destinations
CI / test (pull_request) Successful in 8m9s
CI / test (push) Successful in 7m22s
CI / lint (pull_request) Successful in 2m15s
CI / frontend (pull_request) Successful in 3m1s
CI / reuse (pull_request) Successful in 2s
CI / lint (push) Successful in 2m16s
CI / frontend (push) Successful in 2m10s
CI / reuse (push) Successful in 2s
92697b11c5
Grouping Statistics, Recorder, Settings and About behind Tools left the
tab strip looking identical on all four: the destination's own button
carries the active class, but the strip hides that button, so nothing
was marked.  The page titles named the page without saying how you got
there.

Mark the Tools button when the active destination is one the strip hides.
That state is read from the button's computed display rather than from a
second copy of the grouping, so the two cannot drift: whatever ui-core
puts in the menu lights up Tools, and a destination promoted back into
the strip stops doing so with no further change.

Tools already carries the tab class, so the existing active styling
applies unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GdyUjuXejCEfiub675z6cz
Signed-off-by: Stan Grams <sjg@haxx.space>
sjg merged commit 92697b11c5 into main 2026-08-03 00:24:04 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sjg/trx-rs#34