Skip to content

fix(alerts): repair 404 on View full logs anomaly link#193

Merged
TerrifiedBug merged 1 commit intomainfrom
fix/anomaly-logs-404
Apr 28, 2026
Merged

fix(alerts): repair 404 on View full logs anomaly link#193
TerrifiedBug merged 1 commit intomainfrom
fix/anomaly-logs-404

Conversation

@TerrifiedBug
Copy link
Copy Markdown
Owner

@TerrifiedBug TerrifiedBug commented Apr 28, 2026

Summary

Fixes Notion bug: 404 on "View full logs" under anomaly alerts.

The link in error-context-panel.tsx pointed at /pipelines/[id]/logs which is not a route — pipeline logs render inline on /pipelines/[id] via a togglable side panel.

  • Change href to /pipelines/[id]?logs=1
  • Read ?logs=1 in /pipelines/[id]/page.tsx to initialize logsOpen=true so the panel auto-opens on deep-link navigation

Test plan

  • Trigger an anomaly with error context, click "View full logs" → lands on pipeline page with logs panel open
  • Direct visit /pipelines/[valid-id]?logs=1 → logs panel open by default
  • Direct visit /pipelines/[valid-id] → logs panel closed by default (no regression)

Greptile Summary

This PR fixes a 404 by correcting the "View full logs" link in error-context-panel.tsx from the non-existent /pipelines/[id]/logs route to /pipelines/[id]?logs=1, and reads that query param in page.tsx to auto-open the logs side panel on deep-link navigation. The core fix is correct and the lazy useState initialiser is the right pattern for one-shot URL-driven state.

Confidence Score: 4/5

Safe to merge — the fix is correct and the only finding is a missing Suspense wrapper that generates a build warning but does not cause a runtime failure.

Only P2 findings present; score stays at 4/5 per the P2-only ceiling guidance.

src/app/(dashboard)/pipelines/[id]/page.tsx — needs a Suspense boundary around PipelineBuilderInner to satisfy Next.js App Router requirements for useSearchParams.

Important Files Changed

Filename Overview
src/app/(dashboard)/alerts/_components/error-context-panel.tsx Fixes broken "View full logs" link — replaces the non-existent /pipelines/[id]/logs route with the correct /pipelines/[id]?logs=1 deep-link URL.
src/app/(dashboard)/pipelines/[id]/page.tsx Adds useSearchParams to read ?logs=1 and initialise logsOpen state; missing <Suspense> wrapper around the consuming component will cause a Next.js build warning.

Sequence Diagram

sequenceDiagram
    participant User
    participant AlertPanel as ErrorContextPanel
    participant PipelinePage as /pipelines/[id]/page

    User->>AlertPanel: clicks "View full logs"
    AlertPanel->>PipelinePage: navigate to /pipelines/[id]?logs=1
    PipelinePage->>PipelinePage: useSearchParams().get("logs") === "1"
    PipelinePage->>PipelinePage: useState initialiser → logsOpen = true
    PipelinePage->>User: renders with logs panel open
Loading

Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/app/(dashboard)/pipelines/[id]/page.tsx
Line: 203

Comment:
**`useSearchParams` requires a Suspense boundary**

Next.js requires any component that calls `useSearchParams()` to be wrapped in a `<Suspense>` boundary; without one, the entire route tree de-opts from partial prerendering (PPR) and Next.js emits a build warning (`MISSING_SUSPENSE_WITH_CSR_BAILOUT`). Since `PipelineBuilderInner` is already nested inside `ReactFlowProvider`, the simplest fix is to wrap it in `Suspense` inside `PipelineBuilderPage`:

```tsx
import { Suspense } from "react";

export default function PipelineBuilderPage() {
  const params = useParams<{ id: string }>();
  return (
    <ReactFlowProvider>
      <Suspense>
        <PipelineBuilderInner pipelineId={params.id} />
      </Suspense>
    </ReactFlowProvider>
  );
}
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(alerts): repair "View full logs" 404..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

The "View full logs" button on the anomaly error context panel pointed
to /pipelines/[id]/logs, which doesn't exist as a route. Logs are
rendered inline on /pipelines/[id] via a togglable side panel.

- Change href to /pipelines/[id]?logs=1
- Read ?logs=1 in the pipeline page to initialize logsOpen=true so
  the panel auto-opens on deep-link navigation
@github-actions github-actions Bot added the fix label Apr 28, 2026
const [discardOpen, setDiscardOpen] = useState(false);
const [metricsOpen, setMetricsOpen] = useState(false);
const [logsOpen, setLogsOpen] = useState(false);
const [logsOpen, setLogsOpen] = useState(() => searchParams.get("logs") === "1");
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.

P2 useSearchParams requires a Suspense boundary

Next.js requires any component that calls useSearchParams() to be wrapped in a <Suspense> boundary; without one, the entire route tree de-opts from partial prerendering (PPR) and Next.js emits a build warning (MISSING_SUSPENSE_WITH_CSR_BAILOUT). Since PipelineBuilderInner is already nested inside ReactFlowProvider, the simplest fix is to wrap it in Suspense inside PipelineBuilderPage:

import { Suspense } from "react";

export default function PipelineBuilderPage() {
  const params = useParams<{ id: string }>();
  return (
    <ReactFlowProvider>
      <Suspense>
        <PipelineBuilderInner pipelineId={params.id} />
      </Suspense>
    </ReactFlowProvider>
  );
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/app/(dashboard)/pipelines/[id]/page.tsx
Line: 203

Comment:
**`useSearchParams` requires a Suspense boundary**

Next.js requires any component that calls `useSearchParams()` to be wrapped in a `<Suspense>` boundary; without one, the entire route tree de-opts from partial prerendering (PPR) and Next.js emits a build warning (`MISSING_SUSPENSE_WITH_CSR_BAILOUT`). Since `PipelineBuilderInner` is already nested inside `ReactFlowProvider`, the simplest fix is to wrap it in `Suspense` inside `PipelineBuilderPage`:

```tsx
import { Suspense } from "react";

export default function PipelineBuilderPage() {
  const params = useParams<{ id: string }>();
  return (
    <ReactFlowProvider>
      <Suspense>
        <PipelineBuilderInner pipelineId={params.id} />
      </Suspense>
    </ReactFlowProvider>
  );
}
```

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code Fix in Codex

@github-actions github-actions Bot added fix and removed fix labels Apr 28, 2026
@TerrifiedBug TerrifiedBug merged commit 83bf177 into main Apr 28, 2026
15 checks passed
@TerrifiedBug TerrifiedBug deleted the fix/anomaly-logs-404 branch April 28, 2026 08:46
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.

1 participant