fix(tracking,hooks): aria-hidden decorative icons + accurate stale comments#585
Merged
fix(tracking,hooks): aria-hidden decorative icons + accurate stale comments#585
Conversation
… update stale comments Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve tracking UX and update legal policy
fix(tracking,hooks): aria-hidden decorative icons + accurate stale comments
Mar 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses accessibility and documentation accuracy around tracking UI icons and the useBackToExit deep-mode back-press behavior.
Changes:
- Add
aria-hidden="true"to decorativeBookOpenicons in tracking headers to avoid redundant screen-reader announcements. - Update stale comments/docblocks in
useBackToExithook and its tests to reflect actual dashboard vs non-dashboard behavior. package-lock.jsoncontains substantial dependency metadata churn beyond the stated scope.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/app/(protected)/tracking/TrackingClient.tsx |
Marks decorative header icons as aria-hidden for better screen reader output. |
src/hooks/useBackToExit.ts |
Updates docblock wording describing sentinel/back behavior. |
src/hooks/__tests__/useBackToExit.test.ts |
Updates section banner comment to match current deep-mode behavior. |
package-lock.json |
Large lockfile churn (dev/peer metadata changes, removals). |
Comment on lines
+27
to
29
| * that have NO sentinel key → on a dashboard route the press is ignored; | ||
| * on any other route it counts toward deep-mode (see Behaviour above). | ||
| * |
There was a problem hiding this comment.
The updated docblock correctly describes dashboard vs non-dashboard behavior, but the inline comment in handlePopState still says mid-app back presses are ignored entirely. This contradiction will make the hook harder to maintain; please update the later comment to match the deep-mode counting logic (dashboard ignored, non-dashboard increments depth).
Suggested change
| * that have NO sentinel key → on a dashboard route the press is ignored; | |
| * on any other route it counts toward deep-mode (see Behaviour above). | |
| * | |
| * that have NO sentinel key. In that case, a back press on a dashboard route | |
| * is ignored, while a back press on any non-dashboard route increments the | |
| * deep-mode counter (see Behaviour above). |
devakesu
added a commit
that referenced
this pull request
Mar 6, 2026
* feat(tracking,legal): improve tracking UX and align legal policy updates - add sticky course headers on tracking page - add right-side scroll-to-bottom floating button near tracking controls - switch accept-terms success navigation to router.replace to prevent back nav to terms - update legal policy text (Turnstile clarity, AWS ap-south-1 disclosure, Kochi jurisdiction) - bump terms version to 2.5 and align legal effective date docs/env examples - enhance legal page external link visibility and secure external link behavior - update related tests and mocks (tracking + save-token terms version) * fix(tracking,pwa): refine pinned course header and reset deep back-exit state - use header-based scroll detection for pinned course title timing - adjust scroll-to-end FAB margins slightly on mobile and md breakpoints - reset non-dashboard back counter when exit state/toast is cleared - add regression test for deep-mode threshold expiry re-arming behavior * fix(pwa,tracking): extract clearState helper, consolidate depth counter into navDepthRef, fix Tailwind utilities (#583) * Initial plan * fix(pwa,tracking): extract clearState helper, use navDepthRef for deep-back tracking, fix Tailwind utilities Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com> * refine(pwa): clarify navDepthRef semantics and add comment on intentional separation from clearState Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com> * fix(pwa): merge navDepthRef into single qualifying-back counter, remove nonDashboardBackCountRef Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com> * fix(pwa,tracking): toast race condition, scroll setState deduplication, activeCourseMeta lookup trim consistency (#584) * Initial plan * fix(tracking,pwa): guard toast callbacks, deduplicate scroll setState, fix activeCourseMeta lookups Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com> * fix(tracking): remove unused cardVariants and improve toast dismissal logic in useBackToExit * fix(legal): normalize legal effective date format and improve handling * Update src/app/config/legal.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Devanarayanan <fusion@devakesu.com> * fix(tracking,hooks): aria-hidden decorative icons + accurate stale comments (#585) * Initial plan * fix(tracking,hooks): add aria-hidden to decorative BookOpen icons and update stale comments Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com> --------- Signed-off-by: Devanarayanan <fusion@devakesu.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Addresses four review comments from the latest review on #582: two accessibility fixes on decorative icons and two stale comment/docblock corrections to match the actual deep-mode exit behavior.
Accessibility
aria-hidden="true"to decorativeBookOpenicons in both the fixed pinned-course header and the per-course section header inTrackingClient.tsx— prevents screen readers from announcing themDocumentation / comments
useBackToExit.test.ts— was "Mid-app back press — ignored entirely"; now correctly states dashboard backs are ignored while non-dashboard backs accumulate toward the deep-mode exit thresholduseBackToExit.ts— removed "ignores them entirely" and replaced with accurate dashboard/non-dashboard split, cross-referencing the Behaviour bulletsType of Change
Related Issues
Relates to #582
Changes Made
TrackingClient.tsx—aria-hidden="true"on pinned-header and per-course-headerBookOpeniconsuseBackToExit.test.ts— updated mid-app section comment to reflect accumulation behavioruseBackToExit.ts— corrected "Sentinel mechanism" docblock paragraphVersion Bump
node scripts/bump-version.js(fork PRs)Testing
Test Environment
Tests Performed
npm run test)npm run test:e2e)npm run lint)Test Coverage
All 21
useBackToExitunit tests pass. No logic changes — only comment/docstring corrections and attribute additions.Documentation
Checklist
Screenshots (if applicable)
No visual changes.
Additional Notes
No logic changes. CodeQL: 0 alerts.
For maintainers:
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.