Skip to content

fix(nav): stop project navbar items clipping off-screen#7968

Open
kyle-ssg wants to merge 4 commits into
mainfrom
fix/project-nav-overflow
Open

fix(nav): stop project navbar items clipping off-screen#7968
kyle-ssg wants to merge 4 commits into
mainfrom
fix/project-nav-overflow

Conversation

@kyle-ssg

@kyle-ssg kyle-ssg commented Jul 8, 2026

Copy link
Copy Markdown
Member
  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

  • Fix flex gap detection for overflow
  • Rename project tabs. "Feature Lifecycle" -> "Lifecycle" and "Release Pipelines" -> "Pipelines".

How did you test this code?

Viewed features page with different widths

The project navbar overflow logic mis-measured available width, letting
items (e.g. Project Settings) clip past the right edge instead of
collapsing into the overflow menu.

- Read the real flex gap and subtract container padding instead of
  guessing; measure item widths with getBoundingClientRect so fractional
  widths are not lost.
- Re-measure when a visible item changes size after the first pass
  (async permission-gated links, count badges).
- Wrap rendered children so DOM nodes map 1:1 with items, and split the
  admin-only links into separate items so they overflow independently.

Also shorten two labels: "Feature Lifecycle" -> "Lifecycle" and
"Release Pipelines" -> "Pipelines".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kyle-ssg kyle-ssg requested a review from a team as a code owner July 8, 2026 15:20
@kyle-ssg kyle-ssg requested review from talissoncosta and removed request for a team July 8, 2026 15:20
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview, Comment Jul 8, 2026 4:56pm
flagsmith-frontend-staging Ready Ready Preview, Comment Jul 8, 2026 4:56pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jul 8, 2026 4:56pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0cebefc6-8569-406a-9890-ffac63afea45

📥 Commits

Reviewing files that changed from the base of the PR and between 3416939 and 67c8814.

📒 Files selected for processing (1)
  • frontend/common/hooks/useOverflowVisibleCount.ts

📝 Walkthrough

Walkthrough

This PR modifies the overflow visible-count hook to subtract container padding from the measured width, and changes OverflowNav to wrap each rendered item in a dedicated div. It also renames the project lifecycle link, changes the release pipelines label to “Pipelines”, and splits the project and organisation admin links into separate conditional render blocks.

Estimated code review effort: 3 (Moderate) | ~20 minutes


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

@github-actions github-actions Bot added front-end Issue related to the React Front End Dashboard fix labels Jul 8, 2026
The admin-only Organisation Integrations and Organisation Settings links
were wrapped in a single fragment, so the overflow logic treated them as
one double-width item and dropped both at once instead of hiding just the
one that no longer fits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-7968 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-7968 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-7968 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7968 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7968 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-7968 Finished ✅ Results

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 57889e17-5427-45a6-aaab-0ba47c41e344

📥 Commits

Reviewing files that changed from the base of the PR and between 26ddf19 and 87a1748.

📒 Files selected for processing (3)
  • frontend/common/hooks/useOverflowVisibleCount.ts
  • frontend/web/components/navigation/OverflowNav.tsx
  • frontend/web/components/navigation/navbars/ProjectNavbar.tsx

Comment thread frontend/common/hooks/useOverflowVisibleCount.ts Outdated
@github-actions github-actions Bot added fix and removed fix labels Jul 8, 2026
Debounce the ResizeObserver re-measure through requestAnimationFrame so a
burst of resize entries triggers a single setWidths reset instead of one
per entry, and cancel any pending frame on cleanup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 2 suites
duration  11.7 seconds
commit  87a1748
info  🔄 Run: #18099 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

failed  1 failed

Details

stats  1 test across 1 suite
duration  49.5 seconds
commit  87a1748
info  📦 Artifacts: View test results and HTML report
🔄 Run: #18099 (attempt 1)

Failed tests

firefox › tests/roles-test.pw.ts › Roles Tests › Roles can be created with project and environment permissions @enterprise

### Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  4 passed

Details

stats  4 tests across 3 suites
duration  33.2 seconds
commit  87a1748
info  🔄 Run: #18099 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 2 suites
duration  11.3 seconds
commit  f3ac95c
info  🔄 Run: #18100 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  4 passed

Details

stats  4 tests across 3 suites
duration  41.1 seconds
commit  f3ac95c
info  🔄 Run: #18100 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

failed  1 failed

Details

stats  1 test across 1 suite
duration  35.2 seconds
commit  f3ac95c
info  📦 Artifacts: View test results and HTML report
🔄 Run: #18100 (attempt 1)

Failed tests

firefox › tests/roles-test.pw.ts › Roles Tests › Roles can be created with project and environment permissions @enterprise

### Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  7 passed

Details

stats  7 tests across 5 suites
duration  59.9 seconds
commit  87a1748
info  🔄 Run: #18099 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  40.8 seconds
commit  3416939
info  🔄 Run: #18101 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  4 passed

Details

stats  4 tests across 3 suites
duration  43.5 seconds
commit  3416939
info  🔄 Run: #18101 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

failed  1 failed

Details

stats  1 test across 1 suite
duration  21.4 seconds
commit  3416939
info  📦 Artifacts: View test results and HTML report
🔄 Run: #18101 (attempt 1)

Failed tests

firefox › tests/roles-test.pw.ts › Roles Tests › Roles can be created with project and environment permissions @enterprise

### Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

failed  1 failed

Details

stats  1 test across 1 suite
duration  12.8 seconds
commit  3416939
info  📦 Artifacts: View test results and HTML report
🔄 Run: #18101 (attempt 2)

Failed tests

firefox › tests/roles-test.pw.ts › Roles Tests › Roles can be created with project and environment permissions @enterprise

### Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

failed  1 failed

Details

stats  1 test across 1 suite
duration  13.6 seconds
commit  3416939
info  📦 Artifacts: View test results and HTML report
🔄 Run: #18101 (attempt 3)

Failed tests

firefox › tests/roles-test.pw.ts › Roles Tests › Roles can be created with project and environment permissions @enterprise

### Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  5 passed

Details

stats  5 tests across 3 suites
duration  20.7 seconds
commit  67c8814
info  🔄 Run: #18108 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  4 passed

Details

stats  4 tests across 3 suites
duration  44.9 seconds
commit  67c8814
info  🔄 Run: #18108 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 2 suites
duration  37.2 seconds
commit  67c8814
info  🔄 Run: #18108 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  4 passed

Details

stats  4 tests across 3 suites
duration  37.9 seconds
commit  67c8814
info  🔄 Run: #18108 (attempt 1)

@github-actions github-actions Bot added fix and removed fix labels Jul 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/common/hooks/useOverflowVisibleCount.ts (1)

56-85: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Resize tracking stops for overflowed items. useOverflowVisibleCount only observes itemsCont.children, and OverflowNav.tsx renders (isMeasuring ? items : visible), so once an item moves into overflow it is unmounted from the measuring container and can no longer be watched. If async content changes size while hidden, the cached width goes stale and the next fit calculation can be wrong. Keep overflowed items mounted in the measuring container, or reattach the observer when the rendered child set changes.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b9642139-7a5c-4a3c-bf2b-6226a101e852

📥 Commits

Reviewing files that changed from the base of the PR and between f3ac95c and 3416939.

📒 Files selected for processing (1)
  • frontend/common/hooks/useOverflowVisibleCount.ts

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

19 screenshots compared. See report for details.
View full report

@kyle-ssg kyle-ssg marked this pull request as draft July 8, 2026 16:22
The extra behaviours added to useOverflowVisibleCount — a per-child
ResizeObserver re-measure and reading the real column-gap — changed
measurement for every consumer of the hook, including the modal Tabs.
That regressed the roles e2e (the Permissions tab briefly became
non-interactive), so revert those and keep only the container-padding
subtraction, which is what actually stopped the navbar items clipping.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added fix and removed fix labels Jul 8, 2026
@kyle-ssg kyle-ssg requested a review from matthewelwell July 8, 2026 17:09

@matthewelwell matthewelwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Superficial review of the code + manual test via preview link.

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

Labels

fix front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants