Skip to content

feat(viewer): add contextual diagnostics drawer - #1649

Open
kunickiaj wants to merge 1 commit into
adam/feat-viewer-redacted-diagnostics-apifrom
09-07-feat_viewer_add_contextual_diagnostics_drawer
Open

feat(viewer): add contextual diagnostics drawer#1649
kunickiaj wants to merge 1 commit into
adam/feat-viewer-redacted-diagnostics-apifrom
09-07-feat_viewer_add_contextual_diagnostics_drawer

Conversation

@kunickiaj

@kunickiaj kunickiaj commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Description

Adds the typed diagnostics API client and accessible right-side drawer with filters, technical-detail reveal, pause/resume, stale and retry states, queued updates, bounded pagination, and Health/Advanced entry points. Refreshes reuse the viewer app coordination and stop while hidden, paused, or closed.

Type of Change

  • 🚀 Feature (new functionality)
  • 🧪 Testing (test-only changes)

Testing

  • Relevant checks pass locally (pnpm run tsc, pnpm run lint, pnpm run test)
  • Added/updated tests for changes
  • Manually verified changes work as expected

Checklist

  • Code follows project style (pnpm run lint passes for touched files)
  • Self-review completed
  • Documentation updated (if needed)
  • No new warnings introduced

Copy link
Copy Markdown
Owner Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T05:41:03.685974Z c463454 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 309c1f2a60

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/components/diagnostics/state.ts Outdated
@kunickiaj
kunickiaj force-pushed the adam/feat-viewer-redacted-diagnostics-api branch from ecde519 to 4b6ef61 Compare September 8, 2026 02:49
@kunickiaj
kunickiaj force-pushed the 09-07-feat_viewer_add_contextual_diagnostics_drawer branch from 309c1f2 to ac40087 Compare September 8, 2026 02:49

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac40087fd5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/static/index.html
Comment thread packages/ui/src/components/diagnostics/state.ts Outdated
@kunickiaj
kunickiaj force-pushed the 09-07-feat_viewer_add_contextual_diagnostics_drawer branch from ac40087 to 7908c25 Compare September 8, 2026 03:10

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7908c2571a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/components/diagnostics/use-diagnostics-drawer.ts
@kunickiaj
kunickiaj force-pushed the adam/feat-viewer-redacted-diagnostics-api branch from 4b6ef61 to 03a2437 Compare September 8, 2026 05:17
@kunickiaj
kunickiaj force-pushed the 09-07-feat_viewer_add_contextual_diagnostics_drawer branch from 7908c25 to a20e829 Compare September 8, 2026 05:17

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a20e829ba9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +235 to +238
useEffect(() => {
if (!state.open) return;
void runnerRef.current("replace");
}, [state.open, state.queryRevision]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Resume with a poll instead of replacing loaded history

When a user pauses while reading paginated older events and then resumes, the reducer increments queryRevision, causing this effect to run a replace request. The response overwrites all loaded rows with the newest 50 while the scroll container retains its position, so the event being inspected can disappear and the view can jump. Resume should perform the normal poll/queue reconciliation so older rows and reading position are preserved.

Useful? React with 👍 / 👎.

@kunickiaj
kunickiaj force-pushed the 09-07-feat_viewer_add_contextual_diagnostics_drawer branch from a20e829 to c463454 Compare September 8, 2026 05:34
@kunickiaj
kunickiaj force-pushed the adam/feat-viewer-redacted-diagnostics-api branch from 03a2437 to 270265e Compare September 8, 2026 05:34

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4634545db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

loading: false,
error: true,
announcement: "",
queryRevision: paginationFailed ? state.queryRevision + 1 : state.queryRevision,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve history when older-page requests fail

When “Load older” fails for any reason—including a transient network error or server 500—this increments queryRevision, so the effect in useDiagnosticsDrawer immediately issues a replace request. If that request succeeds, applyResponse overwrites all previously loaded rows with the newest page and loses the reader's history and scroll context. Only restart from page one for a confirmed invalid cursor; ordinary pagination failures should retain the cursor and loaded rows for retry.

Useful? React with 👍 / 👎.

): LoadDiagnosticEventsOptions {
const remaining = MAX_ROWS - state.rows.length;
return {
limit: mode === "older" ? Math.max(1, Math.min(PAGE_SIZE, remaining)) : PAGE_SIZE,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Page through polling gaps before merging cached rows

Every poll requests only the newest 50 matching events without a cursor. If more than 50 events arrive between five-second polls, the response contains only the latest 50 and the reducer merges them directly with the older cached page; the intervening events are never reachable because nextCursor still points below the cached page. For example, after caching events 1–50, a burst through event 110 produces 110–61 plus 50–1, permanently omitting 51–60 even though they are within the 200-row client bound.

Useful? React with 👍 / 👎.

.diagnostics-drawer-overlay {
position: fixed;
inset: 0;
z-index: 45;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Coordinate the drawer with the legacy upgrade modal

When the asynchronous legacy-upgrade check resolves while the diagnostics drawer is open, the upgrade modal opens at z-index 20/21 underneath this new 45/46 drawer, while setLegacyUpgradeBackgroundInert() does not inert or close #diagnosticsDrawerMount. The upgrade notice is therefore obscured by another active modal and is nevertheless marked as shown, so the user can miss it until reloading; defer one modal or explicitly close/inert the drawer before showing the notice.

Useful? React with 👍 / 👎.

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.

1 participant