Skip to content

POC: Replace foundation dropdowns with popover#3458

Merged
Simrayz merged 2 commits intomasterfrom
poc/replace-foundation-dropdowns
Sep 1, 2025
Merged

POC: Replace foundation dropdowns with popover#3458
Simrayz merged 2 commits intomasterfrom
poc/replace-foundation-dropdowns

Conversation

@Simrayz
Copy link
Copy Markdown
Contributor

@Simrayz Simrayz commented Aug 22, 2025

Scope and purpose

Part of meta #2972.

Replaces instances of foundation('dropdown', ...) and creates styles and javascript to create standalone popover components. I used the name popover to differentiate it from existing dropdowns, and because it is the more general name for "place something relative to this element".

Replaces the following lines of foundation js:

$(document).foundation('dropdown', 'reflow');

$(document).foundation('dropdown', 'close', $parent);

Screenshots

Before

"Dropdown" is outside the view.
image

"No way" button doesn't work
image

After

Icon has cursor pointer, and aligned correctly
image

"No way" button works
image

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to NAV can be found in the
Hacker's guide to NAV.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with ruff, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • This pull request is based on the correct upstream branch: For a patch/bugfix affecting the latest stable version, it should be based on that version's branch (<major>.<minor>.x). For a new feature or other additions, it should be based on master.
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • If this results in changes in the UI: Added screenshots of the before and after
  • If this adds a new Python source code file: Added the boilerplate header to that file

@Simrayz Simrayz force-pushed the poc/replace-foundation-dropdowns branch from 4d44222 to 2c294c6 Compare August 22, 2025 07:56
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Test results

   12 files     12 suites   12m 12s ⏱️
2 365 tests 2 365 ✅ 0 💤 0 ❌
6 630 runs  6 630 ✅ 0 💤 0 ❌

Results for commit 2c294c6.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.02%. Comparing base (9140a8a) to head (2c294c6).
⚠️ Report is 404 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3458      +/-   ##
==========================================
+ Coverage   60.99%   61.02%   +0.02%     
==========================================
  Files         610      610              
  Lines       44589    44707     +118     
  Branches       43       43              
==========================================
+ Hits        27199    27282      +83     
- Misses      17380    17415      +35     
  Partials       10       10              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Simrayz Simrayz changed the title Poc/replace foundation dropdowns POC: Replace foundation dropdowns with custom implementation Aug 22, 2025
@Simrayz Simrayz changed the title POC: Replace foundation dropdowns with custom implementation POC: Replace foundation dropdowns with popover Aug 22, 2025
@Simrayz Simrayz self-assigned this Aug 25, 2025
@Simrayz Simrayz requested a review from a team August 28, 2025 09:18
@Simrayz Simrayz marked this pull request as ready for review August 28, 2025 09:19
@johannaengland johannaengland requested review from a team and removed request for a team August 29, 2025 08:30
@Simrayz Simrayz added the discussion Requires developer feedback/discussion before implementation label Aug 29, 2025
Copy link
Copy Markdown
Contributor

@hmpf hmpf left a comment

Choose a reason for hiding this comment

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

Looks fine, possible follow up: use a component template for these, add to style guide.

Copy link
Copy Markdown
Member

@lunkwill42 lunkwill42 left a comment

Choose a reason for hiding this comment

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

LGTM. As @hmpf said, make followup issues :-)

@Simrayz Simrayz merged commit 73733b4 into master Sep 1, 2025
18 checks passed
@Simrayz Simrayz deleted the poc/replace-foundation-dropdowns branch September 1, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discussion Requires developer feedback/discussion before implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants