Skip to content

Simplify strategy switch auth controls#12

Merged
Pigbibi merged 1 commit into
mainfrom
codex/simplify-switch-auth-status
Jun 8, 2026
Merged

Simplify strategy switch auth controls#12
Pigbibi merged 1 commit into
mainfrom
codex/simplify-switch-auth-status

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the main page login management link with simple sign-in/status/sign-out controls
  • stop exposing the admin page from the daily strategy switch console
  • keep public/static pages browse-only by hiding login controls when no Worker session API is available

Tests

  • python3 scripts/sync_strategy_switch_page_asset.py
  • node --check --input-type=module < web/strategy-switch-console/page_asset.js
  • node --check --input-type=module < web/strategy-switch-console/worker.js
  • git diff --check
  • page asset regeneration stability check

@Pigbibi Pigbibi merged commit 069983c into main Jun 8, 2026
2 checks passed
@Pigbibi Pigbibi deleted the codex/simplify-switch-auth-status branch June 8, 2026 20:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb00adc565

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/index.html
Comment on lines +535 to +537
<span class="pill ready auth-status" id="auth-status" hidden></span>
<a class="btn" id="login-link" href="/login" hidden data-i18n="login">登录</a>
<button class="btn" id="logout-button" type="button" hidden data-i18n="logout">退出</button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve hidden auth controls

The new auth controls rely on the hidden attribute, but these elements also match .pill/.btn, whose author CSS sets display: inline-flex; that can override the browser's [hidden] display rule, so the later *.hidden = ... toggles do not reliably hide them. In the static/GitHub Pages fallback this leaves Sign in/Sign out controls visible even though /api/session is unavailable, and on the Worker the inactive auth action can appear beside the active one. Add an explicit [hidden] { display: none !important; } rule or toggle a class that wins.

Useful? React with 👍 / 👎.

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.

1 participant