Repository navigation
fix: refresh an open not-installed app tab when the app is installed - #36347
Conversation
64f6547 to
bd17689
Compare
|
Head 64f6547 red triage: |
bd17689 to
cf07c60
Compare
|
Rebased: main moved in docs/system-specs/modules/app-kit-platform.md since this head went green (27e9359 -> 1ca713c); CI re-running. The previous head bd17689 had no verdicts to answer: Design, First Principles, UX, GPT, Opus, PR Policy (Screenshot Evidence read), Dependency License Gate and CodeQL (actions) all failed closed on the installation API rate limit ( |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. The fix makes the not-installed views listen for the existing [DESIGN-REVIEWED] 31c5ad1 Description read[DESCRIPTION-READ] 331537c99c002c91f759c42fe0f95c1afe79adb7a412e6e75e3bc888274ffb86 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the diff adds or changes no control, string or layout. The not-installed view now gets replaced by the app's real state when the app is installed elsewhere. That is a load-to-content change, so no screenshot is needed. [UX-REVIEWED] 31c5ad1 Description read[DESCRIPTION-READ] e42ba0d0628c955c26038707caa824f76d8d63b6f322af4431e78fb6f80231e7 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The fix works for both not-installed views. The one note: the shell's app-list refresh only runs while one of those views is on screen. Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: when an app is installed from the CLI or another tab, a tab already showing "X isn't installed" for it updates without a reload. FIX.
[FIRST-PRINCIPLES-REVIEWED] 31c5ad1 Description read[DESCRIPTION-READ] c79706a0adad098fe66516a0cad70eafb610d9cbb305ab32e11bf4dc33dfbd85 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: ApproveWhy: the decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. I'm approving this PR: it makes both not-installed views (AppPage after a 404, and BuiltinAppRoute's released state) react to An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
cf07c60 to
52b205f
Compare
52b205f to
f57519d
Compare
|
Rebased onto main at 6d61070 to pick up #36804, the fix for the red-main |
f57519d to
f82695f
Compare
f82695f to
231cce4
Compare
An open "X isn't installed" tab kept saying so after the app was installed from the CLI or another tab, until a reload or a focus change. The gateway already sends the app_reload frame for every install, but only a mounted AppHost listened for it. A new useAppInstalledElsewhere hook lets the two not-installed views (AppPage after a 404, BuiltinAppRoute's released state) hear that frame for their app: it fires mc:apps-changed so the shell re-reads the installed-apps list, and AppPage also re-reads the app's record. Part of #26967
231cce4 to
31c5ad1
Compare
|
Green-age note for head 31c5ad1: Closure proof on fresh main: I merged The earlier reds on this PR were not caused by its diff:
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
This review checked head 31c5ad1. Every install route announces app_reload after it commits the record, and kirocrew app install goes through the gateway when one is running. The new hook matches the app name exactly and dispatches mc:apps-changed, so the shell's existing invalidate-then-refresh path runs. The hook listens only while AppPage's 404 view or BuiltinAppRoute's released state is on screen. A page that already shows the app keeps AppHost's window reload. The tests have no sleeps or clocks, and each guard has a negative test that fails if that guard is removed. PR Readiness is green on this head.
Done well: the fix reuses the single app-list fetcher instead of adding a second one, and the app-kit-platform spec narrows its earlier "changes nothing" sentence in the same commit.
Optional:
- In BuiltinAppRoute.installedElsewhere.test.tsx test 1, set
installed.apps = [{ name: 'shop' }]and rerender after the announce, then assert the compiled page appears. Today the test stops at themc:apps-changeddispatch, so the swap away from the released state is not tested. - The Problem section says the sidebar stayed stale. The fix refreshes the rail only while a not-installed view is open. Other pages still rely on the focus and visibility re-read. A short reply to the First Principles note saying so would close it.
…36347) An open "X isn't installed" tab kept saying so after the app was installed from the CLI or another tab, until a reload or a focus change. The gateway already sends the app_reload frame for every install, but only a mounted AppHost listened for it. A new useAppInstalledElsewhere hook lets the two not-installed views (AppPage after a 404, BuiltinAppRoute's released state) hear that frame for their app: it fires mc:apps-changed so the shell re-reads the installed-apps list, and AppPage also re-reads the app's record. Part of #26967 Hand-resolved backport; original author: Bolin Chen. (cherry picked from commit 9bfa880)
Problem / Motivation
Goal: An open "X isn't installed" app tab updates on its own once that app is installed from the CLI or another tab.
The gateway sends the
app_reloadframe on every install, update and Sync. Only a mounted app host listened for it, so a tab showing the not-installed page for that app kept showing it until the user reloaded the page or left and came back to the tab. The sidebar stayed stale the same way. Found in adoption smoke 3 of the built-in app campaign.Why it matters
A user who opens an app's page, sees "not installed", and installs it from a terminal sees nothing change. The page looks broken until they reload it.
Not a goal
app_reload.app_reload.What changed (motivation → approach → change)
The not-installed page had no host on screen, so nothing heard the frame. A new hook,
useAppInstalledElsewhere(website/src/hooks/useAppInstalledElsewhere.ts), listens formc:app-reloadnaming one app. It is active only while one of the two not-installed views is on screen:AppPageafter a 404, andBuiltinAppRoute's released state for a former built-in. When the frame names that app, the hook firesmc:apps-changed. That is the event every install surface already uses, so the shell re-reads its app list.AppPagealso re-reads the app's record, and the page then shows the app's real state. A page that already shows the app is left to its host, which reloads the window as before. The owning spec, app-kit-platform §18, now says so.Backwards compatibility
Compatible: the hook only adds a listener while a not-installed view is on screen, and it reuses the existing
mc:apps-changedevent.Removes nothing: no path, key, record or check is removed or narrowed.
Tests
website/src/pages/AppPage.installedElsewhere.test.tsx: after a 404, anmc:app-reloadnaming the app re-reads the record and firesmc:apps-changed. A frame for another app does nothing, and a page showing the app does not re-read.website/src/apps/BuiltinAppRoute.installedElsewhere.test.tsx: the released state firesmc:apps-changedfor its own app only, and the compiled page does not listen.mc:apps-changedcases), pass with them, and pass 3 shuffled repeats (--sequence.shuffle).Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
N/A: unit coverage drives the real window events both views listen on.
tsc -p tsconfig.app.json, eslint on the changed files andcheck-i18n-strings.mjspass locally. Semgrep is not installed on this host, so the SAST rules run in CI only.Screenshots / video
Why no screenshot: no layout or text changes; the existing not-installed and app pages render as before, only when they re-read changes.
Related Issues
Part of #26967
Sibling sweep
Swept: git grep -n "InstalledAppSurface app={null}|AppNotFound|mc:app-reload" -- website/src
Sibling: website/src/pages/AppPage.tsx -- changed here
Sibling: website/src/apps/BuiltinAppRoute.tsx -- changed here
Sibling: website/src/pages/chat/SidePanelTabBodies.tsx -- not affected -- a panel tab renders nothing while its app is absent, so it has no not-installed view
Sibling: website/src/desktopWindow/DesktopWindowRoot.tsx -- not affected -- a desktop window closes itself when its app is absent, so it has no not-installed view
Pattern harvest
Rule candidate: review-prompt
Pattern: a view that renders an "absent" state for a server resource must listen for the push event that announces the resource arriving, not only the mounted view.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)