Skip to content

Commit 48510be

Browse files
authored
fix(web): finish Codex sign-in when the tab becomes visible again (#214)
## Related Issue No issue; found while auditing the browser sign-in flow. ## Problem The Codex sign-in composable polls the login status on an interval and immediately when the window regains focus. A tab that was hidden and then shown again without a `focus` event (mobile tab switch, some desktop window managers, background tabs restored by the browser) kept waiting for the next interval tick before it noticed the completed sign-in. ## What changed - `useCodexLogin.ts`: also poll on `document` `visibilitychange` when the document is visible; remove the listener on unmount alongside the focus listener. - `use-codex-login.test.ts`: new case proving a hidden→visible transition polls once and a hidden transition does not. - `apps/pythinker-code/dist-web`: rebuilt from source (`pnpm run build:web`, `check-web-assets` OK). The chunk churn is hash renames only. ## Verification - `pnpm --filter @pymodel/pythinker-web exec vitest run` — 84 files, 1,000 tests passed - `pnpm --filter @pymodel/pythinker-web typecheck`, `check:style` — exit 0 - `pnpm run build:web` + `node apps/pythinker-code/scripts/check-web-assets.mjs` — Web assets OK ## Checklist - [x] I have read the [CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md) document. - [x] I have linked a related issue (external PRs: the issue must have a maintainer's `/approve`). - [x] I have added tests that prove my feature works. - [x] Ran `gen-changesets` skill, or this PR needs no changeset. - [x] Ran `gen-docs` skill, or this PR needs no doc update. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Codex sign-in now completes automatically when you return to the browser tab, in addition to restoring window focus. * Updated web assets include expanded diagram, chart, language, and editor support. * **Bug Fixes** * Improved login-status detection after switching back to the application. * **Tests** * Added coverage for checking login status when the tab becomes visible. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 84fc9d7 commit 48510be

96 files changed

Lines changed: 321 additions & 279 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-code": patch
3+
---
4+
5+
Complete a Codex sign-in as soon as the browser tab becomes visible again, not only when the window regains focus.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"sourceHash": "ad0be8811299a96afcfa243941b6812309cf4597345759fac292edbcf7dea1e4",
2+
"sourceHash": "c05b9ce73324f5a446966d9f931dc804f0f1e73e78daf14e1479d86e58669c1a",
33
"sourceFileCount": 404
44
}

apps/pythinker-code/dist-web/assets/CodeBlockNode-C7tgevOd.js renamed to apps/pythinker-code/dist-web/assets/CodeBlockNode-DvVwTcrb.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/DesignSystemView-D7qbe5PI.js renamed to apps/pythinker-code/dist-web/assets/DesignSystemView-DqkqPAyE.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/Tooltip-DlGXfx2I.js renamed to apps/pythinker-code/dist-web/assets/Tooltip-DBHeeCqj.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-DGcX3vmh.js renamed to apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-Aw-KZNRM.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/arc-Cc63RfT-.js renamed to apps/pythinker-code/dist-web/assets/arc-uQkvEBHU.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-CyYiIyV8.js renamed to apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-D6d_uvof.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)