Skip to content

feat(enterprise): display-only sign-in notice when the login gate relocks an open dashboard - #24499

Merged
chenmingwei23 merged 1 commit into
mainfrom
feat/ee-relock-ui
Oct 27, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
feat/ee-relock-ui

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: When the enterprise login gate closes on a dashboard that is already open, tell the user to sign in again, without losing any page or dialog draft.

Follow-up to #23697 (runtime relock, merged). Since #23697, a lost or expired login closes the gate, and the gateway refuses every API but sign-in with 403 enterprise_gate_closed. The open dashboard stays mounted on purpose, so drafts are kept. But nothing tells the user why every request now fails. #23882 tracks the missing screen.

Review of #23697 removed its relock screen after three rounds of real findings: replacing the app dropped page drafts, a cover above an open modal could not be clicked, and closing the modals to free it dropped their drafts.

Why it matters

Without this, an enterprise user whose login expires sees only a stream of failed requests and no reason or remedy.

Not a goal

  • Pausing the app's own polling while locked. Its requests get 403 and change nothing.
  • Any in-dashboard sign-in action. Sign-in runs in a terminal (kiro-cli login), as on the first-run screen.
  • Any oss behaviour. The notice keys on enterprise_login_required, which only an enterprise gateway sends.
  • Copy buttons or the SSO command on the notice. The full sign-in screen (reload) still shows both. The notice stays minimal by decision.

What changed (motivation → approach → change)

Product-shape decision: the accepted RFC docs/request-for-change/rfc-crew-enterprise-edition.md, section "Enterprise gate" (a lost login closes the gate). The owner rated runtime expiry low priority, so this is the smallest UI that is safe next to open dialogs.

  • New website/src/components/KiroPrerequisiteRelockNotice.tsx. A small card at the top of the window. For the owner it says "Sign in required / Run this in a terminal to sign in again. This notice clears once you do." above kiro-cli login. When the gateway's own command is longer (the desktop app's bundled CLI, or a KIROCREW_KIRO_BIN override off PATH, per login_commands_for), the card cannot let anyone copy it, and the bare command is not that owner's. So the card shows no command and its main line says: open the dashboard in a new window or tab, whose sign-in screen shows the exact command with a copy button, and this window keeps its work. A non-owner cannot sign the gateway in, so they get "Ask the Kiro Crew owner to sign this gateway in again. This notice clears once they do." instead, with no command.
  • Display only. The card is pointer-events-none, has nothing focusable and no event handlers. Every click, key, focus and scroll goes to what is under it, as if it were not there. So it cannot close or block an open Radix dialog, Modal or popover, or touch a draft in one. It sits at z-[10002], above the top modal layer (z-[10001]), so it stays readable, and insets from the safe area (top-safe-offset-4, left-safe, right-safe) so a notched phone does not hide it. It describes the local gateway, so it portals into the local pane's overlay container (localOverlayContainer(), new in website/src/components/overlayRoot.tsx), which App hides while a remote Crew is in front.
  • KiroPrerequisiteGate. The relock path (unlessRelocked, unchanged in when it fires) now renders the app plus the notice, instead of the app alone. The app keeps its tree position, so nothing remounts.
  • Clears by itself. While the gate is closed, the status query already polls every 5 s with a host probe (kiroPrerequisiteIsBlocking). Once the login is back and the gate reopens, the next poll removes the notice.

Spec: docs/system-specs/modules/platform-context.md § Enterprise gate now describes the notice.

Copy reuses sign_in_required. Three new keys, components.kiroPrerequisiteGate.relock_run_in_terminal (the owner line), relock_ask_owner (the non-owner line) and relock_exact_command_hint (the bundled-CLI line), are in every catalog (source website/src/i18n/locales/en.manual.json) under website/src/i18n/locales/ (en-XA regenerated with npm run i18n:pseudo). The first-run owner line ("install Kiro CLI ... this dashboard will open") is wrong during a relock, so it is not reused.

Earlier local review rounds tried a notice with copy and "Check sign-in again" buttons. Each round found one more outside-click or outside-focus handler that those buttons could trip (page shortcut keys, popover focus-outside, capture-phase mousedown in comment and session-control popovers, Radix scroll lock). Dropping the buttons removes that whole class. The poll already does what "Check sign-in again" did.

Backwards compatibility

Compatible. oss gateways never send enterprise_login_required, so they never reach this path. The test oss: an established install that signs out shows no notice and keeps the app pins it. In an enterprise build the only change is the added notice during a relock.

Reader: website/src/components/KiroPrerequisiteGate.tsx:KiroPrerequisiteGate -- crew page -- the relock path now adds the notice beside the app; test/KiroPrerequisiteGate.enterprise.test.tsx

Tests

website/src/test/KiroPrerequisiteGate.enterprise.test.tsx:

  • Relock keeps a page draft. The notice shows the login command, is portaled out of the app's flow, adds no text to it, and clears on the next poll after the gate reopens, with the draft still there.
  • Display only: the card has pointer-events-none and no focusable element. pointerdown, mousedown, click, keydown, focusin, wheel and touchmove fired on it all reach document. Mutation-checked: adding a stopPropagation handler, or dropping pointer-events-none, fails it.
  • An open Radix dialog and an open Modal, each holding a draft, are left open with the draft on relock.
  • The notice lands in the local pane's overlay container, which is hidden while a remote Crew is in front.
  • The owner sees the run-in-a-terminal line and kiro-cli login. The bare command shows no hint. A bundled CLI and an off-PATH KIROCREW_KIRO_BIN command each show the hint as the main line (text-sm, strong), with neither the bare command nor the run-in-a-terminal line nor the long command, and the card stays display only.
  • A non-owner gets the relock ask-the-owner line, and neither "Sign in again to continue." nor the command.
  • oss: an established install that signs out shows no notice and keeps the app.

Local gates: eslint src/ --max-warnings 0, tsc -p tsconfig.app.json, phantom-classes, restyle ratchet, i18n strings and the file line cap all pass. The KiroPrerequisiteGate*, safeArea and src/i18n suites pass (1,287 tests), and check-i18n-keys resolves every key. Local GPT and Opus review ran before the first push.

Manual verification

Built the bundle and ran it in Chromium with every /api route answered locally: the status flips from open to enterprise_login_required and other routes return 403. Each capture shows the notice above an open dialog (the import-setup dialog), which stays open.

Dark Light
Owner owner dark owner light
Non-owner non-owner dark non-owner light
Owner, bundled CLI bundled dark bundled light

Narrow (390 px), owner with bundled CLI: bundled 390

Related Issues

Closes #23882
Refs #23697

Sibling sweep

Siblings: none -- KiroPrerequisiteGate's unlessRelocked is the only relock render path, and every locked branch goes through it

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

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 26, 2026 17:12
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: it adds one display-only notice to the existing relock path, the app keeps its place in the tree, and the commit includes screenshots of this revision.

[DESIGN-REVIEWED] abaf12d

Description read

[DESCRIPTION-READ] 0be127459feca29eafc8b63269a3fdb4039971651f6eb71a2a5b87cc706ebbe7

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 Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of abaf12d6bf52040f11960f4aa95966bd94c93e1c — 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 to check.

What this change ships

Inventory (10 items) — 10 justified

Intent: when a login expires and the gate locks a dashboard that is already open, tell the enterprise user to sign in again without losing drafts. This is an ADDITION; it closes #23882.

  1. When the gate relocks an open enterprise dashboard, a "Sign in required" card appears at the top of the window — justified
  2. The owner sees "run this in a terminal" above kiro-cli login — justified
  3. An owner whose gateway uses a bundled or off-PATH CLI sees no command, only a pointer to open a new window — justified
  4. A non-owner is told to ask the owner to sign in — justified
  5. The card can't be clicked or focused, and input passes through to open dialogs and popovers underneath — justified
  6. The card hides while a remote Crew is in front — justified
  7. The card clears on its own at the next status poll after sign-in — justified
  8. A new exported localOverlayContainer() lookup (one consumer; the gate renders outside the OverlayRootContext provider, so OverlayPortal can't reach the container) — justified
  9. Three new relock strings in every locale catalog — justified
  10. Review screenshots under temp-screenshots/23882/, the review-media path .gitignore and docs/ci/ci-and-reviews.md document — justified

[FIRST-PRINCIPLES-REVIEWED] abaf12d

Description read

[DESCRIPTION-READ] 91a005fd29773d0f779455921457f484a78024b8ae6f196dd4369ea64a344e2d

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 Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

No blocker. The blind reader understood all three notice variants (owner, bundled CLI, non-owner), and the seven committed screenshots show each one in both themes and at 390 px.

Notes

  • relock_exact_command_hint: the blind reader couldn't tell what "open the dashboard in a new window or tab" refers to ("it doesn't say which address to open"; "'Dashboard' might be this very screen"). Reword it to "To sign in again, open this page in a new tab. Its sign-in screen shows the exact command to copy. Your work here stays open."
  • At 390 px (shot-03), the opaque card sits over the top of the dialog and hides its heading. It can't be dismissed, so any header controls up there (title, close X) stay hidden but clickable until sign-in. On narrow widths, drop the card's shadow-2xl/bg-card card treatment and use a compact one-line strip, or reserve top space for it.
  • relock_ask_owner: the reader read "sign this gateway in" (the owner acts) as a different thing from "sign in again" (you act), and didn't know the word "gateway". Use "Ask the Kiro Crew owner to sign in again. This notice clears once they do."

[UX-REVIEWED] abaf12d

Description read

[DESCRIPTION-READ] c1ab6f1f7868ca117f5450ae7fa4b5108487a2abf6a95e259bdd8742e9616e1f

That sha256 names everything this verdict read: the PR description, plus the 10 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 Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] abaf12d

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

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] abaf12d

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

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

@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 Oct 26, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 26, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 26, 2026
@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 Oct 26, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Opus 5.5 (bundled or KIROCREW_KIRO_BIN sign-in command cannot be copied from the relock notice, KiroPrerequisiteRelockNotice.tsx:31): verified in code, real. login_commands_for (src/kiro_crew/kiro_prerequisite_status.py) serves a quoted absolute path, or a PowerShell wrapper on Windows, when the CLI is the desktop app's bundled copy or an off-PATH override. The display-only card made that impossible to copy.

Fixed in 6219855 without making the card interactive. A selectable <code> would bring pointer input back, and a mousedown on it reaches the capture-phase outside-click handlers in open popovers that the earlier rounds hit. Instead:

  • The card always names the bare kiro-cli login.
  • When the served command is not the bare one (bundled_cli, or login_command differs), it adds one line (relock_exact_command_hint): open the dashboard in a new window or tab. That fresh load lands on the existing sign-in screen (SignInCommands), which shows the exact command with a copy button. This window keeps its work.
  • The card stays pointer-events-none select-none with nothing focusable.

Test: points the bundled desktop CLI / a KIROCREW_KIRO_BIN override off PATH to the sign-in screen for the exact command, still display only in website/src/test/KiroPrerequisiteGate.enterprise.test.tsx.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 26, 2026
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Oct 26, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Opus 5.5 (relock notice stays painted over a remote Crew, KiroPrerequisiteRelockNotice.tsx:40): verified in code, real. KiroPrerequisiteGate wraps <App /> through DashboardBootstrap (main.tsx), outside LocalOverlayRoot (App.tsx), so OverlayPortal resolved to document.body, which a Crew switch does not hide.

Fixed in 2e41510. The notice now portals into the local pane's overlay container, which App hides with display:none while a remote Crew is in front. Because the gate is outside that pane's React tree, overlayRoot.tsx gains localOverlayContainer(), which returns the container by its data-local-overlay-root marker. It falls back to the body only where no local pane exists (an embedded or test tree). The card is otherwise unchanged and stays display only.

Test: draws the notice in the local pane overlay, so a remote Crew in front hides it in website/src/test/KiroPrerequisiteGate.enterprise.test.tsx. It fails when the portal target is put back to document.body.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 27, 2026
@iamwhatever

iamwhatever commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

UX (owner line does not say where to run kiro-cli login): real, fixed in 25bde0e. The owner line is now the new key relock_run_in_terminal, "Run this in a terminal to sign in again. This notice clears once you do.", above the command, in every catalog.

Evidence gap (bundled-CLI hint not captured): closed. The description now includes the owner notice with the bundled CLI, dark and light at 1280 px, plus dark at 390 px.

Notes, answered without code:

  • Non-owner wording ("owner", "gateway"): kept. Those are the terms the rest of the dashboard's setup and sign-in screens use for this viewer, and changing them here alone would make the notice disagree with those screens.
  • The card covering the top of an open dialog: it is pointer-events-none, so a dialog's close control under it still takes the click. It sits there by design, so it stays readable above every modal layer. It is about 120 px tall at 1280 px and clears on its own once sign-in returns.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 27, 2026
…ocks an open dashboard

A relock keeps the app mounted and adds a notice beside it, above every
modal layer, saying to sign in again with the login command (a non-owner
is told to ask the owner). The notice is display only: pointer-events-none,
nothing focusable, no handlers, so it cannot close, block or reach into an
open dialog, popover or draft. The status poll keeps probing while locked,
so the notice clears once the gate reopens. oss is unchanged.

Refs #23882
@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 Oct 27, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

UX (the bundled-CLI notice says "Run this" above a command the same card then calls wrong): real, fixed in abaf12d.

  • For a bundled CLI, or a KIROCREW_KIRO_BIN override off PATH, the card now shows no command and no run-in-a-terminal line.
  • Its one main line (text-sm, strong) is the reworded relock_exact_command_hint: "This gateway uses its own copy of Kiro CLI. To sign in again, open the dashboard in a new window or tab: its sign-in screen shows the exact command with a copy button. This window keeps your work." The reword is in every catalog.
  • The plain case (kiro-cli on PATH) is unchanged.
  • The card stays pointer-events-none select-none.
  • Test: points the bundled desktop CLI / a KIROCREW_KIRO_BIN override off PATH to the sign-in screen for the exact command, still display only now asserts that the bare command and the run line are absent and that the hint is the strong text-sm line. Screenshots in the description are retaken from this head.

Notes, answered without code:

  • 390 px: the card is about 200 px tall there and clears on its own once sign-in returns. It takes no pointer input, so the dialog under it stays usable. Reserving space for it in every dialog is out of scope for this low-priority relock path.
  • "gateway" in the non-owner line: kept. It is the term the dashboard's setup and sign-in screens already use for this viewer.

@chenmingwei23
chenmingwei23 merged commit 7bdb168 into main Oct 27, 2026
117 of 118 checks passed
@chenmingwei23
chenmingwei23 deleted the feat/ee-relock-ui branch October 27, 2026 06:05
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 27, 2026
@CrysisDeu

Copy link
Copy Markdown
Contributor

Post-merge review at abaf12d6

Server side still refuses requests and closes sockets on relock — the notice is display-only on top of real enforcement, as intended. Two MINORs for a follow-up:

  • relock_ask_owner in hi.json and bn.json use the formal register; style guides want तुम / তুমি.
  • The alert card is likely aria-hidden while a Radix dialog is open, so screen readers miss it; move it outside the dialog's inert scope or announce via a live region.

Posted by code-reviewer (Kiro Crew member) on behalf of @CrysisDeu. Full report on file.

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.

Enterprise edition: show a sign-in screen when the login gate relocks a running dashboard

3 participants