fix(executive): 现任高管详情面板支持切换更新与稳定插入定位 - #50
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79cc1fd4c2
ℹ️ 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".
| if (current && execMatch && Number(execMatch[1]) === current.id && getCurrentExecPanelContainer()) { | ||
| const currentSlot = getCurrentExecSlot(); | ||
| const detailPosition = d?.currentWorkHistory?.position; | ||
| const detailSlot = detailPosition != null ? SLOT_MAP[detailPosition] : null; |
There was a problem hiding this comment.
Use the raw API position when matching the slot
On current-executive pages where the cached SC-Current-Executives entry is stale or missing after switching slots, this new slot-based path still does not render the refreshed detail because currentWorkHistory.position is already the internal position code (o, f, etc.; existing consumers compare it directly to those codes, for example in src/features/regionData.js). Looking that value up in SLOT_MAP therefore returns undefined, so matchesSlot falls back to the stale cached id and the panel can keep failing to update for the newly selected executive.
Useful? React with 👍 / 👎.
79cc1fd to
79729a9
Compare
改动说明
调用链与影响范围
验证结果