Coordinate global modal priority and focus - #37
Conversation
There was a problem hiding this comment.
💡 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".
| const challenger = ordered.find(({ id }) => id !== current.id); | ||
| if ( | ||
| challenger && | ||
| PRIORITY_RANK[challenger.priority] > PRIORITY_RANK[current.priority] | ||
| ) { |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Testing
npm run checknpx 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.tsxnpm run test:unitnpm run verify -- --source-onlyCloses #28
Release Notes: