Skip to content

fix(org-workbench): align card actions with selected employee (#420) - #421

Merged
waterbro-8 merged 2 commits into
mainfrom
fix/420-stale-action-identity
Sep 22, 2026
Merged

waterbro-8 merged 2 commits into
mainfrom
fix/420-stale-action-identity

Conversation

@sun-970

@sun-970 sun-970 commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #420: switching employees no longer lets the stale PositionCard name A while edit/dismiss fire B.

#417 / #413 keep the previous card on screen while position() is in flight. That is the right visual behavior. The header actions mixed card.data (A) with selectedId (B), so the dismiss dialog could show A's name and delete B.

What changed

  • Card 编辑 / 裁撤 render only when card.data.id === selectedId.
  • Those actions call actionPosition.id, not a mismatched selectedId.
  • SWR for the heading/thread is unchanged: A's card stays visible, without a skeleton, until B's record arrives.

Tests

  • #420 does not dismiss B under A's name while B's position fetch is in flight
  • Existing #413 switch tests and the dismiss+restore IPC test still pass.

node scripts/run-renderer-tests.mjs apps/desktop/renderer/test/App.test.tsx → 88 passed, 0 failed.

Acceptance (#420)

I am not merging. Please review current head.

Stale-while-revalidate (#413) may keep A's PositionCard on screen after
selectedId is already B. Edit/dismiss now bind only when card.data.id
matches selectedId, so the dismiss dialog cannot name A and delete B.

task_ref: #420

verify:
- node scripts/run-renderer-tests.mjs apps/desktop/renderer/test/App.test.tsx
- 88 passed, 0 failed

@waterbro-8 waterbro-8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code review APPROVE (not product 验收), head 174d1eb54374ed1612bd800bfe6c4860b408f6f1.

对照 roleweave #420:#413 SWR 仍用 card.data 画岗位卡,mutating 的 编辑 / 裁撤改走 actionPosition = card.data?.id === selectedId ? card.data : null,dismiss/edit 都绑 actionPosition.id。A→B 在途窗口不会再出现「弹窗写 A、orgApply 删 B」。#413 的 skeleton/thread 行为没动。

测试覆盖 issue repro(hold B 的 position()、裁撤键不出现、B 到达后确认删 docs-writer)。CI 11/11 green。

非产品验收。不自动合。胡奕舟 can merge.

@waterbro-8
waterbro-8 merged commit 6ea0a27 into main Sep 22, 2026
11 checks passed
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.

bug(org-workbench): stale card actions mix previous employee with new selectedId

2 participants