Compare commits

...

1 Commits

Author SHA1 Message Date
Jiang Bohan
fed5fc3944 fix(inbox): stop remounting IssueDetail on new comment/reaction (MUL-1199)
The inbox detail panel keyed `<IssueDetail>` by `selected.id` (inbox-item
id). `deduplicateInboxItems` picks the most recent inbox notification per
issue, so every new `comment:created` / `reaction:added` event for the
currently open issue produced a fresh inbox item with a new id — flipping
the React key and forcing a full unmount/remount of `IssueDetail`. That
wiped the comment composer draft, dropped focus, and reset scroll.

Key on `selected.issue_id` instead: stable for the life of an open issue
(so input + scroll survive incoming events) and still changes when the
user picks a different issue (so state resets between issues, as before).
2026-04-21 15:56:26 +08:00

View File

@@ -212,8 +212,12 @@ export function InboxPage() {
);
const detailContent = selected?.issue_id ? (
// Key by issue_id (not inbox-item id): a new comment/reaction generates a
// new inbox notification for the same issue, and the dedup helper picks the
// newest one — keying on its id would remount IssueDetail on every event,
// wiping the comment composer draft and resetting scroll position.
<IssueDetail
key={selected.id}
key={selected.issue_id}
issueId={selected.issue_id}
defaultSidebarOpen={false}
layoutId="multica_inbox_issue_detail_layout"