Skip to content

Comments

Validate and fix all documentation code examples; add OAuth2 auth events reference#2

Merged
deeleeramone merged 10 commits intomainfrom
copilot/validate-code-examples
Feb 22, 2026
Merged

Validate and fix all documentation code examples; add OAuth2 auth events reference#2
deeleeramone merged 10 commits intomainfrom
copilot/validate-code-examples

Conversation

Copy link
Contributor

Copilot AI commented Feb 21, 2026

Every Python code example in the docs was audited for syntactic validity and API correctness. Several examples referenced non-existent methods, had syntax errors, or were missing entirely for new features.

Documentation fixes

  • components/index.md: Select(..., ...) — positional ... after keyword args is a SyntaxError. Fixed to options=[...].
  • window-management.md: Adopted upstream restructuring (handle = WindowProxy in native mode); fixed executable code blocks — handle.eval()handle.proxy.eval(), handle.eval_with_result()handle.proxy.eval_with_result().
  • why-pywry.md: **0Auth2"** (number zero, mismatched quote) → **OAuth2**.

New content synced from main

  • guides/multi-widget.md — composing Plotly, AG Grid, Div, and Toolbar in one window
  • guides/oauth2.md — full OAuth2 guide (native + deploy modes)
  • reference/auth*.md — 8 OAuth2 API reference pages
  • mkdocs.yml — nav entries for all new pages
  • pywry/auth/ module, frontend/src/auth-helpers.js, examples, and all associated tests brought in from the merged oauth2 PR

Auth events documentation (reference/events.md)

Five auth:* events used in auth-helpers.js and the OAuth2 backend were entirely absent from the event reference:

Event Direction Trigger
auth:login-request JS → Python window.pywry.auth.login()
auth:logout-request JS → Python window.pywry.auth.logout()
auth:state-changed Python → JS Login / session expiry
auth:token-refresh Python → JS Background token refresh
auth:logout Python → JS Server-side logout complete

Added auth:* to reserved namespaces, full directional event tables with payload shapes, and a window.pywry.auth JS API reference.

Flaky E2E test fixes

test_set_always_on_top and test_pywry_toast_is_available both fail intermittently on Windows CI when the WebView2 subprocess fails to register Chrome_WidgetWin_0 in time. Applied @retry_on_subprocess_failure(max_attempts=3, delay=1.0) — the same pattern already used across test_alerts.py — with runtime.stop() cleanup between attempts.

Final state: 317 Python code blocks across 50 documentation files — all syntactically valid.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…thods

Co-authored-by: deeleeramone <85772166+deeleeramone@users.noreply.github.com>
Copilot AI changed the title [WIP] Validate all code examples in documentation for correctness Fix invalid documentation code examples and add missing NativeWindowHandle convenience methods Feb 21, 2026
Copilot AI requested a review from deeleeramone February 21, 2026 01:56
Copilot AI and others added 2 commits February 21, 2026 05:50
Co-authored-by: deeleeramone <85772166+deeleeramone@users.noreply.github.com>
Co-authored-by: deeleeramone <85772166+deeleeramone@users.noreply.github.com>
Copilot AI changed the title Fix invalid documentation code examples and add missing NativeWindowHandle convenience methods Validate and fix documentation code examples; add missing NativeWindowHandle convenience methods Feb 21, 2026
Copilot AI and others added 2 commits February 21, 2026 06:24
…lure

Co-authored-by: deeleeramone <85772166+deeleeramone@users.noreply.github.com>
Co-authored-by: deeleeramone <85772166+deeleeramone@users.noreply.github.com>
Copilot AI changed the title Validate and fix documentation code examples; add missing NativeWindowHandle convenience methods Validate and fix documentation code examples; add missing NativeWindowHandle convenience methods; fix CI flakiness Feb 21, 2026
Co-authored-by: deeleeramone <85772166+deeleeramone@users.noreply.github.com>
Copilot AI changed the title Validate and fix documentation code examples; add missing NativeWindowHandle convenience methods; fix CI flakiness Document OAuth2 auth:* events and fix all documentation code example validity Feb 21, 2026
Co-authored-by: deeleeramone <85772166+deeleeramone@users.noreply.github.com>
Copilot AI changed the title Document OAuth2 auth:* events and fix all documentation code example validity Validate and fix all documentation code examples; add OAuth2 + multi-widget guides Feb 22, 2026
…I fix

Co-authored-by: deeleeramone <85772166+deeleeramone@users.noreply.github.com>
Copilot AI changed the title Validate and fix all documentation code examples; add OAuth2 + multi-widget guides Validate and fix all documentation code examples; add OAuth2 auth events reference Feb 22, 2026
@deeleeramone deeleeramone marked this pull request as ready for review February 22, 2026 02:17
@deeleeramone deeleeramone merged commit 5cbfc1f into main Feb 22, 2026
17 checks passed
@deeleeramone deeleeramone deleted the copilot/validate-code-examples branch February 22, 2026 02:17
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.

2 participants