fix(#540): remove dead sidebarMarkup/badgeFor and the setBadge chain it left orphaned - #543
Conversation
…it left orphaned sidebarMarkup() and badgeFor() in ui/pages/index.js had no caller anywhere in src/ — the live navigation has been the #278 destination shell (desktopNavigationMarkup/navigationGroups in ui/navigation.js) for a while. Deleted both. Following the issue's own "check before deleting" instruction surfaced a larger, connected chain of dead code from the same superseded design: - tests/dashboard-e2e-96.test.js's nav/container-parity test called sidebarMarkup() directly — it was silently validating dead code the whole time, giving false confidence that nav/container parity and landmarks held against the UI users actually see. Retargeted at the live desktopNavigationMarkup()/pageMarkup() pairing instead of dropping the coverage outright; this is a genuine, previously-missing regression test for the real #278 shell. Mutation-tested against two independent real regressions (a nav-id typo, a page container silently omitted) — both correctly caught. - client.js's setBadge('badge-approvals', ...) / setBadge('badge-alerts', ...) calls target ids that only sidebarMarkup() ever rendered — nothing in the live nav does. These were themselves silently dead in PRODUCTION, not just in tests (setBadge no-ops when the element is missing). Removed both calls; the real topbar pending/alert counts already render via separate, live approval-count/alert-count elements. - With those two calls gone, setBadge() in lib.js became the only definition with zero remaining callers anywhere in the concatenated client bundle — removed it too. - tests/dashboard-client-modules.test.js asserted the literal setBadge('badge-approvals', ...) call text existed in the bundle; retargeted to the real live topbar approval-count markup instead of deleting the check outright. Verified: 1950/1950 core tests, 43/43 browser tests, typecheck/lint/ security-audit/validate all clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Strix is installed on this repository, but we couldn't run this PR security review because this workspace's trial has ended. Add a card to resume code reviews here. |
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoRemove dead dashboard sidebar badge code and retarget nav parity tests
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
300 rules✅ Skills:
|
… html check Qodo caught 2 real issues: 1. navIds.length > 0 only proved the live nav rendered SOMETHING — it could pass even if most destinations silently regressed. Now asserts each of the six primary destinations (the same set the #96 browser suite drives) is actually present. Mutation-tested against a real regression (a destination's only child demoted to hidden) — correctly caught. 2. The topbar Approvals-button check matched one strict serialized HTML substring, making it sensitive to benign attribute reordering/ whitespace changes in dashboardHtml() with no behavioral change. Split into three independent, order-tolerant assertions (id, onclick, the count span) covering the same contract. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Addressed both findings:
|
…543) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
sidebarMarkup()andbadgeFor()inui/pages/index.jshad no caller anywhere insrc/— the live navigation has been the #278 destination shell (desktopNavigationMarkup/navigationGroupsinui/navigation.js) for a while. Deleted both.Following the issue's own "check before deleting" instruction surfaced a larger, connected chain of dead code from the same superseded design:
tests/dashboard-e2e-96.test.js's nav/container-parity test calledsidebarMarkup()directly — it was silently validating dead code the whole time, giving false confidence that nav/container parity and landmarks held against the UI users actually see. Retargeted at the livedesktopNavigationMarkup()/pageMarkup()pairing instead of dropping the coverage outright — this is a genuine, previously-missing regression test for the real [P1] Replace the 21-item primary navigation with a six-destination responsive shell #278 shell. Mutation-tested against two independent real regressions (a nav-id typo, a page container silently omitted) — both correctly caught.client.js'ssetBadge('badge-approvals', ...)/setBadge('badge-alerts', ...)calls target ids that onlysidebarMarkup()ever rendered — nothing in the live nav does. These were themselves silently dead in production, not just in tests (setBadgeno-ops when the element is missing). Removed both calls; the real topbar pending/alert counts already render via separate, liveapproval-count/alert-countelements.setBadge()inlib.jsbecame the only definition with zero remaining callers anywhere in the concatenated client bundle — removed it too.tests/dashboard-client-modules.test.jsasserted the literalsetBadge('badge-approvals', ...)call text existed in the bundle — retargeted to the real live topbar approval-count markup instead of deleting the check outright.Verification
Test plan
npm test— 1950/1950npm run test:browser— 43/43npm run typecheck/npm run lint— 0 errorsnode scripts/security-audit.mjs/npm run validate— clean🤖 Generated with Claude Code