Commit 48510be
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
- .changeset
- apps
- pythinker-code/dist-web
- assets
- pythinker-web
- src/composables
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments