Skip to content

fix(executive): 现任高管详情面板支持切换更新与稳定插入定位 - #50

Merged
gangbaRuby merged 2 commits into
mainfrom
fix/current-exec-panel-position
Aug 12, 2026
Merged

fix(executive): 现任高管详情面板支持切换更新与稳定插入定位#50
gangbaRuby merged 2 commits into
mainfrom
fix/current-exec-panel-position

Conversation

@gangbaRuby

Copy link
Copy Markdown
Owner

改动说明

  • 现任高管详情面板改为插入到培训课程进度汇总块之后,定位不再依赖固定 CSS 类名和游戏文案。
  • 修复切换现任高管后面板仍显示上一位高管数据的问题;切换后同步更新并重新插入到当前高管的培训汇总块之后。

调用链与影响范围

  • 影响文件:src/features/executiveTrainingModule.js。
  • 定位基于 React Fiber 的 key="top" 节点,兼容样式包装组件;切换高管时复用已有面板并更新内容。

验证结果

  • npm run check 已通过。
  • 浏览器实机验证尚未完成。

@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: 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".

Comment thread src/features/executiveTrainingModule.js Outdated
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;

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 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 👍 / 👎.

@gangbaRuby
gangbaRuby force-pushed the fix/current-exec-panel-position branch from 79cc1fd to 79729a9 Compare August 12, 2026 16:32
@gangbaRuby
gangbaRuby merged commit a540437 into main Aug 12, 2026
1 check passed
@gangbaRuby
gangbaRuby deleted the fix/current-exec-panel-position branch August 15, 2026 10:44
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