Skip to content

Fix: Add rounded corners to map component for UI consistency#4314

Open
Saurabh-2607 wants to merge 2 commits intoOWASP:mainfrom
Saurabh-2607:fix/map-rounded-corners
Open

Fix: Add rounded corners to map component for UI consistency#4314
Saurabh-2607 wants to merge 2 commits intoOWASP:mainfrom
Saurabh-2607:fix/map-rounded-corners

Conversation

@Saurabh-2607
Copy link
Contributor

Proposed change

Resolves #4311

The map component currently does not have rounded corners, while most other UI elements in the interface use rounded borders. This creates a small visual inconsistency in the design.

This PR adds the same border-radius used across other UI components to the map container so that it aligns with the overall design system.

Changes made

  • Added rounded-lg to the map container.
  • Ensured the map respects the rounded container edges.
  • Maintained consistency with existing UI components.

Result

Before
image

After
Screenshot 2026-03-19 065708

Screenshots

Checklist

  • Required: I followed the contributing workflow
  • Required: I verified that my code works as intended and resolves the issue as described
  • Required: I ran make check-test locally: all warnings addressed, tests passed
  • I used AI for code, documentation, tests, or communication related to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

Summary by CodeRabbit

  • Style
    • Added rounded corners and overflow containment to the chapter display for a cleaner presentation.
    • Made map backgrounds transparent and removed default outlines for a sleeker, integrated look.
    • Introduced dark-mode map background styling so maps match the app’s dark theme consistently.

Walkthrough

Updated ChapterMap markup and global CSS: the map root section receives expanded Tailwind classes and MapContainer inline style is adjusted; global stylesheet adds dark-mode Leaflet container background and forces Leaflet containers to be transparent.

Changes

Cohort / File(s) Summary
ChapterMap component
frontend/src/components/ChapterMap.tsx
Extended root <section> className to relative z-0 overflow-hidden rounded-lg bg-slate-200 dark:bg-[#1a1a1a] isolate; updated MapContainer style to include outline: 'none' and background: 'transparent'.
Global CSS / Leaflet styling
frontend/src/app/globals.css
Added .dark .leaflet-container { background-color: #1a1a1a; } and .leaflet-container { background: transparent !important; } to set dark-mode map background and force transparent map containers globally.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • arkid15r
  • kasya
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix: Add rounded corners to map component for UI consistency' directly and accurately describes the main change in the PR - adding rounded corners to the map component.
Description check ✅ Passed The PR description is directly related to the changeset, explaining the problem, solution, and changes made with before/after screenshots demonstrating the fix.
Linked Issues check ✅ Passed The PR successfully implements the requirements from issue #4311 by adding rounded corners to the map component and ensuring visual consistency with other UI elements through CSS and component styling updates.
Out of Scope Changes check ✅ Passed All changes are scoped to the mapped component styling. The CSS updates for dark mode Leaflet styling and the component className modifications are directly related to achieving the rounded corners and design consistency objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 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.

cubic-dev-ai[bot]
cubic-dev-ai bot previously approved these changes Mar 19, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 19, 2026
@Saurabh-2607 Saurabh-2607 marked this pull request as ready for review March 19, 2026 01:44
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.

@Saurabh-2607 thanks for working on this! Left a comment bellow ⬇️

<section
aria-label="Chapter Map"
className="relative"
className="relative overflow-hidden rounded-lg"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I remembered now why we removed the rounded corners at some point.
With rounded corners there's this lighter "border" that gets pretty noticeable in corners.

Image Image

Do you think we could get rid of this and still keep rounded corners?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me Check

- Set MapContainer background to transparent in ChapterMap.tsx
- Add global CSS override for .leaflet-container to be transparent
- Resolves issue where white background was visible at rounded corners
@Saurabh-2607
Copy link
Contributor Author

@kasya Resolved the Issue about the a border on the edges
image
image

@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: 1

🧹 Nitpick comments (1)
frontend/src/app/globals.css (1)

472-474: Scope the transparent Leaflet override to the ChapterMap container.

Currently only one MapContainer exists in the application (in ChapterMap.tsx), so this global selector doesn't cause cross-page regressions today. However, scope this to the ChapterMap wrapper class to prevent unintended styling if additional Leaflet maps are added. Also consider scoping the dark mode variant on line 320 (.dark .leaflet-container).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/app/globals.css` around lines 472 - 474, The global rule
targeting .leaflet-container should be scoped to the ChapterMap wrapper used in
ChapterMap.tsx to avoid affecting other Leaflet maps; update the selector to
target the wrapper class used by ChapterMap (e.g., .chapter-map
.leaflet-container) instead of the global .leaflet-container, and likewise
update the dark-mode rule (.dark .leaflet-container) to (.dark .chapter-map
.leaflet-container) so both regular and dark-mode overrides are confined to the
ChapterMap component.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/src/app/globals.css`:
- Around line 320-322: The dark-mode background declared for .dark
.leaflet-container is being overridden by a later rule that sets background:
transparent !important; find the conflicting selector (the rule that uses
background: transparent !important on .leaflet-container) and either
remove/relax that transparent override or make the dark rule win by
consolidating them into a single rule (e.g., apply the dark background on
.leaflet-container when .dark is present and include the same
specificity/!important treatment the transparent rule uses); update the existing
.dark .leaflet-container declaration or the transparent rule so only one clear
behavior remains.

---

Nitpick comments:
In `@frontend/src/app/globals.css`:
- Around line 472-474: The global rule targeting .leaflet-container should be
scoped to the ChapterMap wrapper used in ChapterMap.tsx to avoid affecting other
Leaflet maps; update the selector to target the wrapper class used by ChapterMap
(e.g., .chapter-map .leaflet-container) instead of the global
.leaflet-container, and likewise update the dark-mode rule (.dark
.leaflet-container) to (.dark .chapter-map .leaflet-container) so both regular
and dark-mode overrides are confined to the ChapterMap component.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e0965c35-5f4e-40ff-8744-48dd04722ce3

📥 Commits

Reviewing files that changed from the base of the PR and between ea27a08 and 408b61d.

📒 Files selected for processing (2)
  • frontend/src/app/globals.css
  • frontend/src/components/ChapterMap.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/ChapterMap.tsx

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map Component Missing Rounded Corners

2 participants