Skip to content

fix: hand incident chat exits in an app pop-out to the main window - #31314

Merged
bolichen97 merged 1 commit into
mainfrom
fix/26430-incident-chat-popout-exit
Nov 6, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/26430-incident-chat-popout-exit

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: When the ops-mission-control incident chat panel leaves for another page inside an app pop-out, the main window opens that page and the pop-out stays on the app.

The incident chat panel leaves through a full page load. In an app pop-out that load runs in the pop-out window itself: the window turns into a second full dashboard and drops its pop-out registration, so the main window no longer shows the app as popped out. Every other exit from a popped-out app is handed to the main window instead.

Why it matters

Anyone who pops out Ops Mission Control and follows a link out of an incident's chat loses the pop-out: the window becomes a second dashboard, and the main window's pop-out state is wrong until they close it by hand.

Not a goal

  • Changing how the panel leaves on the board in the main window. It keeps its full page load.
  • Keeping an in-app destination inside the pop-out. The panel's exits are chat pages; a hard exit in a pop-out goes to the main window.
  • Carrying a URL fragment (#...) to the main window. The pop-out's other exits do not carry one either.

What changed (motivation → approach → change)

The panel's navigator called window.location.assign directly, so it never reached the hard-exit sink an app pop-out installs for exactly this case. That sink only knew one destination, /chat, because its one caller was the hard "Ask the agent" hand-off.

The sink now receives the destination, an app-space path with its query. A new hardNavigate(to) in utils/errorReport.ts uses the sink when one is installed and falls back to the same full page load otherwise; sendErrorToChat's hard path calls it with /chat, so that path behaves as before. The pop-out's sink (AppPopoutHardExit in pages/AppPopoutFrame.tsx) splits the destination into path and query and hands it to the main window through the frame's existing handOffToMain. IncidentChat.tsx (the ops-mission-control panel) passes hardNavigate as its navigator.

Backwards compatibility

Compatible: outside an app pop-out no sink is installed, so the panel and the hard "Ask the agent" hand-off still do the same full page load; in a pop-out the hard "Ask the agent" still hands /chat to the main window.

Removes nothing: the hard-exit sink gains a parameter its one installer now reads; no path, key or behaviour is taken away.

Tests

  • IncidentChat.cov80.test.tsx: with a hard exit installed, the panel's exit goes to it with the destination and loads no page. Fails on main, where the panel calls window.location.assign.
  • AppPopoutFrame.test.tsx: in the pop-out as App.tsx mounts it, hardNavigate('/chat?sid=chat-9') is handed to the main window with path /chat, query ?sid=chat-9 and session chat-9, and this window does not navigate. Fails on main, where the sink always forwards /chat with no query.
  • Determinism: both files ran 5 times with --sequence.shuffle and different seeds, all green; each new test restores its location.assign spy and clears the module-level sink in finally (or on unmount).

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

N/A — unit coverage sufficient: the two tests drive both ends of the seam (the panel's navigator and the pop-out's sink as App.tsx mounts it), and the existing hard "Ask the agent" pop-out tests still pass unchanged.

Screenshots / video

Why no screenshot: the change is where a navigation goes; no component, layout or string changes.

Related Issues

Closes #26430

Sibling sweep

Swept: git grep -nE "location.(assign|href\s*=|replace()" -- website/src
Sibling: website/src/components/AddJobSplitButton.tsx:63 -- not affected -- rendered by the Schedule page and the mobile connect modal, neither of which runs in an app pop-out
Sibling: website/src/pages/chat/BrowserLiveCard.tsx:267 -- not affected -- uses the router's navigate whenever a router is mounted, so a pop-out's pinned navigator hands its exits off
Sibling: website/src/hooks/useRefreshScheduler.ts:131 -- not affected -- a forced re-authentication reload of the whole window, not an exit from an app
Sibling: website/src/utils/popoutController.ts:474 -- not affected -- the chat and artifact pop-outs' own navigator, outside an app pop-out

Pattern harvest

Rule candidate: review-prompt
Pattern: a component that can render inside an app pop-out leaves with window.location.assign instead of the router's navigate or hardNavigate, so the pop-out turns into a dashboard.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 09:22
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 09:22
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 593f5c5de27b7fbbe0cd0afe44383c319742253b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing to check. The diff only changes which window a link from the incident chat opens in. It adds or changes no control, string or layout, so no screenshot is needed.

[UX-REVIEWED] 593f5c5

Description read

[DESCRIPTION-READ] b099e8c03f18e2454a64a1d819dd82073fd3764e5ba5afafedec8011c2f67ccd

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 593f5c5de27b7fbbe0cd0afe44383c319742253b — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. This is a linked-issue fix (#26430) that sends the panel through the hard-exit sink the pop-out already had; no second mechanism is added.

What this change ships

Inventory (4 items) — 4 justified

Intent: when someone follows a link out of an incident's chat inside a popped-out Ops Mission Control, the page should open in the main window and the pop-out should stay on the app. This is a FIX.

  1. In an app pop-out, a link out of the incident chat panel opens in the main window and the pop-out keeps its registration — justified
  2. Outside a pop-out, the panel still does a full page load — justified
  3. A hard "Ask the agent" in a pop-out now hands /chat to the main window through the shared hardNavigate, with no change in behaviour — justified
  4. The hard-exit sink now receives the destination path and query, and a new exported hardNavigate uses it (2 callers: IncidentChat.tsx and sendErrorToChat) — justified

Sibling count: I grepped location\.(assign|href\s*=|replace\() over website/src, excluding tests, and got 19 hits. 4 are comments. The other 15 are new-tab handles, reloads, iframe loads, the chat and artifact pop-out navigators, the router-aware BrowserLiveCard, the new hardNavigate itself, or surfaces that never render in an app pop-out. None is an unfixed sibling.

[FIRST-PRINCIPLES-REVIEWED] 593f5c5

Description read

[DESCRIPTION-READ] 55672fab70316caa6fdc44663cae62f98f5e8e3ff5e7dee8b4ecd0d4cc48109d

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 593f5c5de27b7fbbe0cd0afe44383c319742253b — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 593f5c5

Verdict parsed from the review's SHA-scoped output markers for commit 593f5c5de27b7fbbe0cd0afe44383c319742253b.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 593f5c5de27b7fbbe0cd0afe44383c319742253b false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 593f5c5de27b7fbbe0cd0afe44383c319742253b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the hard-exit sink is the right place to send the panel's exit through, and it now takes the destination from its callers.

[DESIGN-REVIEWED] 593f5c5

Description read

[DESCRIPTION-READ] 9f400d966888edac70574a491d4ce8a2cf565704a6f61aa1d9433c69faa74971

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 593f5c5de27b7fbbe0cd0afe44383c319742253b and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 593f5c5

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 593f5c5de27b7fbbe0cd0afe44383c319742253b false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 09:43
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
The ops-mission-control incident chat panel leaves through a full page
load. Inside an app pop-out that load ran in the pop-out itself, which
turned the window into a second dashboard and dropped its pop-out
registration.

The panel now leaves through hardNavigate, which uses the hard exit an
app pop-out installs and keeps the full page load everywhere else. The
pop-out's hard exit takes the destination, so it hands the panel's
path and query to the main window the way the frame's other exits do.

Closes #26430
@bolichen97
bolichen97 force-pushed the fix/26430-incident-chat-popout-exit branch from 322e052 to 593f5c5 Compare November 6, 2026 13:02
@bolichen97

bolichen97 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/pages/ and test/test_apps_* (neighbours of this PR's files) since this head's CI ran (4d208a0 -> 07ab5da); CI re-running. The previous head's only red was framerMotionMockStableTags.test.ts flagging ChatSidebar.boardRenameOfflineScope.test.tsx, a file this PR does not touch, which main fixed in #31279; the patch itself is unchanged.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 6, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tier 1 auto-approve: fix (5 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: routes the incident chat's full-page exits through hardNavigate so an app pop-out hands them to the main window, with tests.

@bolichen97
bolichen97 merged commit 57030af into main Nov 6, 2026
97 of 98 checks passed
@bolichen97
bolichen97 deleted the fix/26430-incident-chat-popout-exit branch November 6, 2026 15:08
buluoray pushed a commit that referenced this pull request Nov 8, 2026
…31314)

The ops-mission-control incident chat panel leaves through a full page
load. Inside an app pop-out that load ran in the pop-out itself, which
turned the window into a second dashboard and dropped its pop-out
registration.

The panel now leaves through hardNavigate, which uses the hard exit an
app pop-out installs and keeps the full page load everywhere else. The
pop-out's hard exit takes the destination, so it hands the panel's
path and query to the main window the way the frame's other exits do.

Closes #26430

(cherry picked from commit 57030af)
buluoray pushed a commit that referenced this pull request Nov 8, 2026
…31314)

The ops-mission-control incident chat panel leaves through a full page
load. Inside an app pop-out that load ran in the pop-out itself, which
turned the window into a second dashboard and dropped its pop-out
registration.

The panel now leaves through hardNavigate, which uses the hard exit an
app pop-out installs and keeps the full page load everywhere else. The
pop-out's hard exit takes the destination, so it hands the panel's
path and query to the main window the way the frame's other exits do.

Closes #26430

(cherry picked from commit 57030af)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ops-mission-control: IncidentChat's hard exit turns an app pop-out into a dashboard

2 participants