Skip to content

fix: markedWhenCompleted indicator now displays correctly when using all navigation components#4055

Draft
walldenfilippa wants to merge 2 commits intomainfrom
fix/4054-marked-when-completed-navigation
Draft

fix: markedWhenCompleted indicator now displays correctly when using all navigation components#4055
walldenfilippa wants to merge 2 commits intomainfrom
fix/4054-marked-when-completed-navigation

Conversation

@walldenfilippa
Copy link
Contributor

@walldenfilippa walldenfilippa commented Mar 11, 2026

…onents

Description

Pages that were fully completed only received the markWhenCompleted indicator after the user navigated forward to the next page using the navigation buttons. Only after this initial navigation did markWhenCompleted update correctly across the side navigation, the custom button, and the navigation menu. This is now fixed in this PR.

TODO:

  1. Issue persists on page1
  2. Update and fix unit tests

Related Issue(s)

Verification/QA

  • Manual functionality testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)
    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs
    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • Support in Altinn Studio
    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board
    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels
    • I have added a kind/* and backport* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

Summary by CodeRabbit

  • Refactor
    • Removed internal page visit tracking from navigation functions and simplified related dependencies.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

The pull request removes visited-pages tracking logic from the useNavigatePage hook by eliminating the useVisitedPages hook usage and related state updates, simplifying navigation dependency management and addressing inconsistent behavior with the markWhenCompleted indicator.

Changes

Cohort / File(s) Summary
Navigation Hook Refactoring
src/hooks/useNavigatePage.ts
Removes useVisitedPages hook binding, setVisitedPages state updates, and dependency array entries from navigation functions. Simplifies the navigation logic by eliminating per-navigation visited-pages mutations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing the markedWhenCompleted indicator display across navigation components, which directly aligns with the primary objective.
Linked Issues check ✅ Passed The PR addresses the core requirement from #4054: fixing markedWhenCompleted indicator to display correctly immediately after page completion regardless of navigation method used.
Out of Scope Changes check ✅ Passed All changes in useNavigatePage.ts (removing visited pages tracking and useVisitedPages hook) are directly related to fixing the navigation state management issue described in #4054.
Description check ✅ Passed The PR description includes all required sections with the Related Issue, Verification/QA checklist completed, and closure of issue #4054 documented.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/4054-marked-when-completed-navigation
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@walldenfilippa walldenfilippa marked this pull request as draft March 11, 2026 13:40
@walldenfilippa walldenfilippa added kind/bug Something isn't working backport This PR should be cherry-picked onto older release branches squad/utforming Issues that belongs to the named squad. labels Mar 13, 2026
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR should be cherry-picked onto older release branches kind/bug Something isn't working squad/utforming Issues that belongs to the named squad.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

‘markWhenCompleted’ in the side navigation menu only activates after users navigate using the navigation buttons

1 participant