Skip to content

Conversation

@swankystark
Copy link

@swankystark swankystark commented Dec 10, 2025

Proposed change

Resolves #2839

  • Changed overlay text from 'Click to interact with map' to 'Unlock map'
  • Added unlock icon (faLockOpen) from FontAwesome before text
  • Updated aria-label for better accessibility
  • Updated all related unit tests
  • All tests passing (30/30)

Checklist

  • [ ✅ ] I've read and followed the contributing guidelines.
  • [ ✅ ] I’m on Windows, so I cannot run make directly, but I ran the test suite using npx jest and all tests passed. If needed, I can rerun the checks inside WSL.

- Changed overlay text from 'Click to interact with map' to 'Unlock map'
- Added unlock icon (faLockOpen) from FontAwesome before text
- Updated aria-label for better accessibility
- Updated all related unit tests

All tests passing (30/30)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 10, 2025

Summary by CodeRabbit

  • Style

    • Updated the map activation interface with a new "Unlock map" prompt and added lock icon for improved clarity
  • Tests

    • Updated test cases to reflect the new map unlock prompt text and corresponding accessibility attributes

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

The pull request updates the ChapterMap component's interactive overlay prompt text from "Click to interact with map" to "Unlock map" and adds a lock icon (faLockOpen) alongside it. Both the component and its unit tests are updated to reflect this change.

Changes

Cohort / File(s) Summary
ChapterMap Component Update
frontend/src/components/ChapterMap.tsx
Replaced overlay activation prompt text to "Unlock map" with a new lock icon (FontAwesomeIcon faLockOpen). Updated aria-label and restructured the overlay content to display as a flex row with the icon and text. Added FontAwesome imports.
ChapterMap Tests Update
frontend/__tests__/unit/components/ChapterMap.test.tsx
Updated all Interactive Overlay test assertions to verify the new "Unlock map" text and corresponding aria-label expectations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Straightforward text and icon replacements with no logic changes
  • Test updates follow a consistent, repetitive pattern
  • Minor structural changes to accommodate the lock icon display

Possibly related PRs

Suggested labels

frontend, frontend-tests

Suggested reviewers

  • arkid15r
  • kasya

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately summarizes the main change: updating the map overlay text to 'Unlock map' with an unlock icon.
Linked Issues check ✅ Passed The pull request fully implements the requirements from issue #2839: replacing 'Click to interact with map' with 'Unlock map' and adding the faLockOpen icon.
Out of Scope Changes check ✅ Passed All changes are directly related to the objective of updating the map overlay button text and icon; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly relates to the changeset, detailing the text replacement, icon addition, accessibility improvements, and test updates that match the code changes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@sonarqubecloud
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
frontend/__tests__/unit/components/ChapterMap.test.tsx (1)

268-316: Overlay interaction tests correctly updated to the new “Unlock map” label

The Interactive Overlay tests now assert against “Unlock map” while still verifying all key behaviors (initial visibility, removal on click, scrollWheelZoom enabling, Enter/Space keyboard handling, and aria-label). This keeps the suite tightly aligned with the UI change without losing coverage. As an optional enhancement, you could add an assertion that the overlay still renders the icon if you want explicit regression coverage for the visual cue, but it’s not required for this change.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66533c3 and ad12904.

📒 Files selected for processing (2)
  • frontend/__tests__/unit/components/ChapterMap.test.tsx (4 hunks)
  • frontend/src/components/ChapterMap.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-17T17:30:42.139Z
Learnt from: anurag2787
Repo: OWASP/Nest PR: 2671
File: frontend/__tests__/unit/components/MultiSearch.test.tsx:169-171
Timestamp: 2025-11-17T17:30:42.139Z
Learning: In the OWASP/Nest frontend tests (PR #2671 context), wrapper functions like `expectChaptersCountEqualsThree` that simply call another helper with a fixed parameter (e.g., `expectChaptersCountEquals(3)`) are intentionally used to avoid arrow function callbacks in `waitFor` calls. This pattern prevents adding nesting depth that would trigger rule typescript:S2004. Example: `await waitFor(expectChaptersCountEqualsThree)` avoids the extra nesting from `await waitFor(() => expectChaptersCountEquals(3))`.

Applied to files:

  • frontend/__tests__/unit/components/ChapterMap.test.tsx
📚 Learning: 2025-06-21T12:21:32.372Z
Learnt from: ahmedxgouda
Repo: OWASP/Nest PR: 1633
File: frontend/src/components/GradientRadialChart.tsx:67-116
Timestamp: 2025-06-21T12:21:32.372Z
Learning: The react-apexcharts Chart component does not support ARIA attributes like aria-label and role as direct props. To add accessibility attributes to ApexCharts in React, wrap the Chart component in a container div with the appropriate ARIA attributes.

Applied to files:

  • frontend/__tests__/unit/components/ChapterMap.test.tsx
🔇 Additional comments (2)
frontend/src/components/ChapterMap.tsx (2)

5-6: FontAwesome icon imports align with intended usage

The faLockOpen and FontAwesomeIcon imports match how you’re using the unlock icon in the overlay and are consistent with standard @fortawesome/react-fontawesome patterns; no issues from this change.

If FontAwesome wasn’t already in use elsewhere, please double-check that the corresponding packages/versions are present in package.json and installed so this doesn’t introduce a runtime import error.


149-154: Overlay label + icon change correctly implements “Unlock map” behavior

The updated overlay keeps the existing interaction model (click + keyboard) while:

  • Setting aria-label="Unlock map" on the button, and
  • Rendering a flex row with FontAwesomeIcon(faLockOpen) followed by the “Unlock map” text.

This cleanly satisfies the PR/issue requirements without altering map behavior; a11y remains intact and arguably clearer.

Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

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

@swankystark Hi! Please run make check-test locally and address found issues ✔️

Comment on lines +151 to +153
<p className="flex items-center gap-2 rounded-md bg-white/90 px-5 py-3 text-sm font-medium text-gray-700 shadow-lg dark:bg-gray-700 dark:text-white">
<FontAwesomeIcon icon={faLockOpen} className="h-4 w-4" />
Unlock map
Copy link
Collaborator

Choose a reason for hiding this comment

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

@swankystark Could you also add some hover effect to this button?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change main page map button text

2 participants