Skip to content
This repository was archived by the owner on Sep 20, 2026. It is now read-only.

Coordinate global modal priority and focus - #37

Merged
cauyxy merged 2 commits into
masterfrom
yxinyux/issue-28-modal-coordinator
Jul 18, 2026
Merged

cauyxy merged 2 commits into
masterfrom
yxinyux/issue-28-modal-coordinator

Conversation

@cauyxy

@cauyxy cauyxy commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

  • add an app-wide modal coordinator with critical, confirmation, system, and informational priorities plus FIFO ordering
  • route destructive confirmations, updater, and support payment through one active-dialog surface with explicit dismissal policies
  • restore focus after dismissal and make shell disclosures controlled and keyboard-operable
  • update current truth documentation and verification coverage

Testing

  • npm run check
  • npx vitest run src/features/shared/modalCoordinator.test.ts src/features/shared/modalCoordinator.integration.test.ts src/layouts/ShellHeader.test.tsx src/components/ui/ConfirmDialog.test.tsx
  • npm run test:unit
  • npm run verify -- --source-only
  • macOS Tauri smoke: startup detection completed; frontend, overlay, and settings returned HTTP 200
  • browser Preview: modal count/queue surfaces, Support payment focus restoration, Bilibili Escape focus restoration, route navigation, and overflow/console checks

Closes #28

Release Notes:

  • 全局弹窗现在按确定优先级依次显示,并在关闭后恢复到合适的操作焦点。

@cauyxy
cauyxy merged commit a189d41 into master Jul 18, 2026
2 of 4 checks passed
@cauyxy
cauyxy deleted the yxinyux/issue-28-modal-coordinator branch July 18, 2026 19:19

@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: 407ba8fa59

ℹ️ 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 on lines +63 to +67
const challenger = ordered.find(({ id }) => id !== current.id);
if (
challenger &&
PRIORITY_RANK[challenger.priority] > PRIORITY_RANK[current.priority]
) {

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 Honor FIFO when active priority is demoted

When a higher-priority modal preempts an older source and then updates down into that older source's priority, this strict > check keeps the newer modal active even though sortedEntries() would put the older queued modal first. For example, an older confirmation queued behind a critical modal remains hidden after the critical modal downgrades to confirmation, violating the documented FIFO ordering within equal priorities until the newer modal closes.

Useful? React with 👍 / 👎.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

建立全局 Modal 协调、优先级和焦点恢复

1 participant