[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
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
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>
This commit was merged in pull request #34.
This commit is contained in:
@@ -5592,6 +5592,8 @@ function navigateToTab(name, options = {}) {
|
|||||||
_activeTab = name;
|
_activeTab = name;
|
||||||
document.querySelectorAll(".tab-bar .tab").forEach((t) => t.classList.remove("active"));
|
document.querySelectorAll(".tab-bar .tab").forEach((t) => t.classList.remove("active"));
|
||||||
btn.classList.add("active");
|
btn.classList.add("active");
|
||||||
|
const toolsBtn = document.getElementById("mobile-more-btn");
|
||||||
|
if (toolsBtn) toolsBtn.classList.toggle("active", getComputedStyle(btn).display === "none");
|
||||||
window.trxUi?.syncSelectedTab(document.querySelector(".tab-bar-nav"), btn);
|
window.trxUi?.syncSelectedTab(document.querySelector(".tab-bar-nav"), btn);
|
||||||
document.querySelectorAll(".tab-panel").forEach((p) => p.style.display = "none");
|
document.querySelectorAll(".tab-panel").forEach((p) => p.style.display = "none");
|
||||||
const panel = document.getElementById(`tab-${name}`);
|
const panel = document.getElementById(`tab-${name}`);
|
||||||
|
|||||||
@@ -4600,6 +4600,12 @@ function navigateToTab(name: TabName, options: { updateHistory?: boolean; replac
|
|||||||
_activeTab = name;
|
_activeTab = name;
|
||||||
document.querySelectorAll(".tab-bar .tab").forEach((t) => t.classList.remove("active"));
|
document.querySelectorAll(".tab-bar .tab").forEach((t) => t.classList.remove("active"));
|
||||||
btn.classList.add("active");
|
btn.classList.add("active");
|
||||||
|
// A destination the strip hides is reached through Tools, so mark that
|
||||||
|
// button instead — otherwise the strip looks identical on all four of them.
|
||||||
|
// Derived from what is actually hidden rather than from a second copy of the
|
||||||
|
// grouping, which would drift from the one ui-core installs.
|
||||||
|
const toolsBtn = document.getElementById("mobile-more-btn");
|
||||||
|
if (toolsBtn) toolsBtn.classList.toggle("active", getComputedStyle(btn).display === "none");
|
||||||
window.trxUi?.syncSelectedTab(document.querySelector(".tab-bar-nav"), btn);
|
window.trxUi?.syncSelectedTab(document.querySelector(".tab-bar-nav"), btn);
|
||||||
document.querySelectorAll<HTMLElement>(".tab-panel").forEach((p) => p.style.display = "none");
|
document.querySelectorAll<HTMLElement>(".tab-panel").forEach((p) => p.style.display = "none");
|
||||||
const panel = document.getElementById(`tab-${name}`);
|
const panel = document.getElementById(`tab-${name}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user