Skip to content

fix(tracking,hooks): aria-hidden decorative icons + accurate stale comments#585

Merged
devakesu merged 2 commits into3.0.4from
copilot/sub-pr-582
Mar 6, 2026
Merged

fix(tracking,hooks): aria-hidden decorative icons + accurate stale comments#585
devakesu merged 2 commits into3.0.4from
copilot/sub-pr-582

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

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

  • Added aria-hidden="true" to decorative BookOpen icons in both the fixed pinned-course header and the per-course section header in TrackingClient.tsx — prevents screen readers from announcing them

Documentation / comments

  • Updated the test section banner in 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 threshold
  • Updated the "Sentinel mechanism" docblock in useBackToExit.ts — removed "ignores them entirely" and replaced with accurate dashboard/non-dashboard split, cross-referencing the Behaviour bullets

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test updates

Related Issues

Relates to #582

Changes Made

  • TrackingClient.tsxaria-hidden="true" on pinned-header and per-course-header BookOpen icons
  • useBackToExit.test.ts — updated mid-app section comment to reflect accumulation behavior
  • useBackToExit.ts — corrected "Sentinel mechanism" docblock paragraph

Version Bump

  • Version automatically bumped by workflow (same-repo PRs)
  • Version manually bumped using node scripts/bump-version.js (fork PRs)
  • Version already up-to-date (no bump needed)

Testing

Test Environment

  • Node version: 22
  • npm version: 10
  • OS: Linux

Tests Performed

  • Unit tests pass (npm run test)
  • E2E tests pass (npm run test:e2e)
  • Linting passes (npm run lint)
  • Manual testing completed

Test Coverage

All 21 useBackToExit unit tests pass. No logic changes — only comment/docstring corrections and attribute additions.

Documentation

  • Documentation updated (if needed)
  • Code comments added for complex logic
  • API documentation updated (if API changes)

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

No visual changes.

Additional Notes

No logic changes. CodeQL: 0 alerts.


For maintainers:

  • PR title follows conventional commit format
  • Version bump is correct
  • All checks pass
  • Documentation is complete
  • Ready to merge

🔒 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.

Copilot AI mentioned this pull request Mar 6, 2026
10 tasks
… 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
@devakesu devakesu marked this pull request as ready for review March 6, 2026 04:26
@devakesu devakesu self-requested a review as a code owner March 6, 2026 04:26
Copilot AI review requested due to automatic review settings March 6, 2026 04:26
@devakesu devakesu merged commit 971b4a1 into 3.0.4 Mar 6, 2026
@devakesu devakesu deleted the copilot/sub-pr-582 branch March 6, 2026 04:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 decorative BookOpen icons in tracking headers to avoid redundant screen-reader announcements.
  • Update stale comments/docblocks in useBackToExit hook and its tests to reflect actual dashboard vs non-dashboard behavior.
  • package-lock.json contains 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).
*
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants