Repository navigation
fix(app): pass the Home automations entry into the projects view instead of reading contexts there - #66635
Conversation
HomeUtilityNav read the router and AutomationSource contexts itself, so the SSH stories that mount HomeProjectsView on its own threw and never showed the Authenticate button. The app's Home now builds the entry and passes it down as a prop, like the other utility actions.
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
There was a problem hiding this comment.
I reproduced the CI failure on the base branch, and it's gone with this change. On the base, ssh-reconnect.spec.ts:18 times out waiting for Authenticate; with this PR, all 7 tests in ssh-reconnect.spec.ts pass. bun test ./src/home passes (65), and tsc -b is clean in packages/app and packages/gui-plugins.
Moving useNavigate/useAutomationSource up into HomeOverview and passing an optional automations entry down keeps the projects view props-driven, like settings and help. Every caller is covered: the app's Home passes the entry, and both stories that mount the view on its own leave it out.
Public API: unchanged (only internal props of the app's Home components).
No concerns.
What failed
check-test / e2e (linux|windows, app-components):component-tests/ssh-reconnect.spec.ts › cancelling a sign-in from Home offers it again at oncetimed out waiting for theAuthenticatebutton.Root cause
#66393 made
HomeUtilityNav(always rendered byHomeProjectsView) calluseNavigate()anduseAutomationSource()directly. Theapp-dialog-ssh--authentication-requiredstory mountsHomeProjectsViewon its own, without a router or anAutomationSourceProvider, so the component throws. The Projects dropdown never shows Authenticate, and the click times out after 60s.Fix
The Home projects view stays props-driven, like its other utility actions (
onOpenSettings,onOpenHelp):HomeUtilityNavandHomeProjectsViewtake an optionalautomationsentry ({ available, open }) and show the Automations button only when it is passed and available.createHomeProjectsControllertakes an optionalautomationsoption and exposes it asutility.automations.HomeOverview(the app's Home, inside the shell'sAutomationSourceProviderand router) builds the entry fromuseAutomationSource()andnavigate("/automations").HomeProjectsandHomeViewpass it down.The app behaves the same. Stories that mount the view on its own leave the entry out.
Verification
bunx playwright test --config playwright.components.config.ts component-tests/ssh-reconnect.spec.ts:18 --retries 0fails (timed out waiting for Authenticate).bunx playwright test --config playwright.components.config.ts component-tests/ssh-reconnect.spec.ts --retries 0: 7 passed.tsc -binpackages/app: clean.bun test --conditions=solid ... ./src/home: 65 pass.Note: the same jobs also fail
plugin-host.spec.ts:1706(theme picker lists "Modus" where "Monokai" is expected). That failure is unrelated and not addressed here.CI failure:
check-test / e2e (linux, app-components) / [components] component-tests/ssh-reconnect.spec.ts › cancelling a sign-in from Home offers it again at once,check-test / e2e (windows, app-components) / [components] component-tests\ssh-reconnect.spec.ts › cancelling a sign-in from Home offers it again at oncefailed 3 runs in a row ondev.d97b226(first failing: run 12991)c39ad3b782125f"feat(app): show where automations run and which session they wake (feat(app): show where automations run and which session they wake #66393)" (feat(app): show where automations run and which session they wake #66393) by @neriousyOpened by the CI fix job: it does not merge or push to
dev.