fix(web): break circular links in DegradedProjectState — Back to project and Open dashboard view both point to current page#1868
Conversation
Both "Back to project" and "Open dashboard view" linked to
projectDashboardPath(projectId) — the same page the component is
rendered on. Replace with working navigation:
- "Back to project" → "/" (global dashboard)
- "Open dashboard view" → "/projects/{id}/settings" (edit config)
Fixes #1867
Test Coverage Report
|
Both "Back to project" and "Open dashboard view" linked to
projectDashboardPath(projectId) — the same page the component is
rendered on. Replace with working navigation:
- "Back to project" → "/" (global dashboard)
- "Open dashboard view" → "/projects/{id}/settings" (edit config)
Fixes #1867
Greptile SummaryThis PR fixes circular navigation in
Confidence Score: 5/5Safe to merge — the change is a targeted removal of two self-referential links replaced by a single correct outbound link, with no side effects on data or navigation state. The fix is minimal and correct: both circular links are removed, the replacement "Back to dashboard" points to a valid, non-circular route, the unused import is cleaned up, and the new + updated tests all align with the final implementation. The only open question is a PR-description discrepancy about a missing "Edit settings" link, which does not affect correctness. No files require special attention.
|
| Filename | Overview |
|---|---|
| packages/web/src/components/DegradedProjectState.tsx | Circular links fixed; two links collapsed into one "Back to dashboard" → "/". PR description mentions an "Edit settings" link that was never added. |
| packages/web/src/components/tests/DegradedProjectState.test.tsx | New unit test suite covering heading, error display, config path parsing, link destinations, and repair button visibility — comprehensive and correct. |
| packages/web/src/app/projects/[projectId]/page.test.tsx | Integration test updated to assert "Back to dashboard" → "/" and absence of "Edit settings". |
| packages/web/src/app/projects/[projectId]/settings/page.test.tsx | Integration test updated consistently with the component page test; correctly verifies no "Edit settings" link (which would be circular on this page). |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User opens /projects/id] --> B{Project degraded?}
B -- No --> C[Render normal Dashboard]
B -- Yes --> D[Render DegradedProjectState]
D --> E["Back to dashboard link\nhref = /"]
E --> F[Global Dashboard /]
subgraph Before fix
D2[DegradedProjectState] --> G["Back to project\nhref = /projects/id circular"]
D2 --> H["Open dashboard view\nhref = /projects/id circular"]
end
subgraph After fix
D3[DegradedProjectState] --> I["Back to dashboard\nhref = /"]
end
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/web/src/components/DegradedProjectState.tsx:62-69
**PR description describes an "Edit settings" link that isn't in the implementation**
The PR description lists "Open dashboard view" → **"Edit settings"** linking to `/projects/{id}/settings` as one of the two changes, and the test plan (step 4) even includes `Click "Edit settings" → navigates to /projects/{id}/settings ✅`. However, the actual component only renders the single "Back to dashboard" link — no "Edit settings" link was added. The tests also explicitly assert `queryByRole("link", { name: "Edit settings" })` is absent, so this appears intentional. If it is, the description and test plan should be updated; if it was accidentally dropped, a user on the degraded-project page has no direct path to the settings page to repair their config without first navigating back to the global dashboard.
Reviews (2): Last reviewed commit: "fix(web): remove circular 'Edit settings..." | Re-trigger Greptile
The 'Edit settings' link pointed to /projects/{id}/settings, which also
renders DegradedProjectState — making the button a self-link on the
settings page. Remove it entirely; 'Back to dashboard' (/) is the only
escape hatch needed.
Add DegradedProjectState component tests and assert both pages show no
'Edit settings' link and that 'Back to dashboard' points to /.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Fixes broken/circular navigation in the web UI’s degraded-project view by ensuring the degraded-state “Back” action navigates to a different route (the global dashboard), and adds/updates tests to lock in the corrected link behavior.
Changes:
- Update
DegradedProjectStateto replace circular project dashboard links with a single “Back to dashboard” link to/. - Add a dedicated
DegradedProjectStateunit test suite covering headings, path extraction, link target, and repair-button gating. - Update project page and settings page tests to assert the corrected link target and absence of an “Edit settings” link in degraded mode.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/web/src/components/DegradedProjectState.tsx | Replaces circular links with a single working “Back to dashboard” link to /. |
| packages/web/src/components/tests/DegradedProjectState.test.tsx | Adds focused unit tests for degraded-state rendering, link target, and repair visibility logic. |
| packages/web/src/app/projects/[projectId]/settings/page.test.tsx | Updates degraded-settings-page assertions for the new link target and removed self-link. |
| packages/web/src/app/projects/[projectId]/page.test.tsx | Updates degraded-project-page assertions for the new link target and removed self-link. |
whoisasx
left a comment
There was a problem hiding this comment.
Reviewed thoroughly against current main. The final implementation fixes the circular DegradedProjectState navigation by replacing the self-referential project links with a single working Back to dashboard escape route. It also correctly avoids the secondary settings-page circular-link case, since the settings route can render the same degraded state.
The added component and page-level tests cover the corrected link behavior, absence of the removed Edit settings action, config path rendering, and repair-button gating. I also verified a clean local merge onto current main, focused changed tests, full web test suite, lint on changed files, and web typecheck after rebuilding local core declarations.
Looks good to merge from my side.
Summary
Fixes circular navigation links in `DegradedProjectState` component.
Original bug: Both "Back to project" and "Open dashboard view" linked to `projectDashboardPath(projectId)` — the exact same page the component is rendered on (`/projects/{id}`). Clicking either button did nothing (Next.js `` to current route = no-op).
Secondary bug (found during testing): After fixing the first button, "Edit settings" pointed to `/projects/{id}/settings` — which also renders `DegradedProjectState`. So on the settings page, "Edit settings" was itself a self-link. Removed the button entirely; it has no useful action when the project is degraded.
Changes:
Fixes #1867
Test
Screen.Recording.2026-05-20.at.6.28.52.PM.mov