Skip to content

fix(web): break circular links in DegradedProjectState — Back to project and Open dashboard view both point to current page#1868

Merged
neversettle17-101 merged 3 commits into
mainfrom
fix/degraded-project-circular-links
May 21, 2026
Merged

fix(web): break circular links in DegradedProjectState — Back to project and Open dashboard view both point to current page#1868
neversettle17-101 merged 3 commits into
mainfrom
fix/degraded-project-circular-links

Conversation

@i-trytoohard

@i-trytoohard i-trytoohard commented May 15, 2026

Copy link
Copy Markdown
Contributor

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:

  • "Back to project" → "Back to dashboard" linking to `/` (global dashboard, works from both pages)
  • "Open dashboard view" → removed "Edit settings" link entirely (was circular on settings page)
  • Removed unused `projectDashboardPath` import
  • Added `DegradedProjectState` component test suite (9 tests)
  • Updated page-level tests to assert correct link targets and absence of "Edit settings"

Fixes #1867

Test

  1. Add a project whose `agent-orchestrator.yaml` exists but is malformed (e.g. `port: [unclosed`)
  2. Navigate to `/projects/{id}` — degraded state renders
  3. Click "Back to dashboard" → navigates to `/` ✅
  4. No "Edit settings" button present ✅
  5. Navigate to `/projects/{id}/settings` directly — degraded state renders with different heading
  6. Click "Back to dashboard" → navigates to `/` ✅
  7. No "Edit settings" button present ✅
Screen.Recording.2026-05-20.at.6.28.52.PM.mov

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
@github-actions

github-actions Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Test Coverage Report

Metric Value
Lines covered 53/53
Lines not covered 0/53
Overall coverage 100.0%

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-apps

greptile-apps Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes circular navigation in DegradedProjectState where both "Back to project" and "Open dashboard view" buttons linked to the same projectDashboardPath(projectId) route the component was already rendered on, making both buttons effectively no-ops.

  • Removes the two self-referential links and replaces them with a single "Back to dashboard" link pointing to /.
  • Removes the now-unused projectDashboardPath import.
  • Adds a focused unit test suite for DegradedProjectState and updates integration tests for both the project page and settings page to assert the correct link text and destination.

Confidence Score: 5/5

Safe 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.

Important Files Changed

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
Loading
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

Comment thread packages/web/src/components/DegradedProjectState.tsx Outdated
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>

Copilot AI 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.

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 DegradedProjectState to replace circular project dashboard links with a single “Back to dashboard” link to /.
  • Add a dedicated DegradedProjectState unit 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 whoisasx 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.

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.

@neversettle17-101 neversettle17-101 merged commit 50dc18f into main May 21, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(web): DegradedProjectState links are circular \u2014 "Back to project" and "Open dashboard view" point to current page

4 participants