feat(team-inbox): unified team inbox - #578
Merged
Merged
Conversation
team_inbox_list_page/unread_count/mark_read/mark_all_read/mark_unread have existed in the project-management crate and been invoked by the frontend since the feature was re-added after the #521 revert, but the handler_list.inc registration never came back with it. Every Team Inbox IPC call has been rejecting at the Tauri boundary as an unknown command.
The readAt check before calling markRead/markUnread lived only in TeamInboxView, so any other caller could double-fire a mutation on an item that's already in the target state. The coordinator's own optimistic patch already recomputes unread deltas from live cache state on each call, so client-side counts stayed safe, but a redundant call still meant an unnecessary local/cloud round trip on every double click. Move the guard into setReadState, checked against the live cache rather than the caller's (possibly stale) item snapshot, so it holds regardless of caller.
The coordinator already reverts an item's own optimistic readAt on a failed mutation, but nothing forced a resync against server truth afterwards, so a failure racing with another concurrent update could leave the list or badge quietly drifted. Extract the success/failure/resync orchestration out of TeamInboxView into a pure, framework-free helper (repo policy is no .tsx unit tests) and wire handleSelect/handleMarkRead/handleMarkUnread through it. Covers the success path, failure with revert already handled by the coordinator plus resync trigger, and resync failure not masking the original mutation error.
The unread-count badge's aria-label was a hardcoded English template literal, so screen reader users on every non-English locale heard English. Thread the existing teamInbox.unreadCount translation (it was already in common.json, just unused here) down through usePinnedMenuItems into buildPinnedMenuItems, with the old string kept only as a fallback for callers that don't supply it.
teamInbox only existed in en and zh common.json; every other shipped locale (de, es, fr, ja, ko, pl, pt, ru, tr, vi, zh-Hant) fell back to raw English for the whole feature. Add the namespace to all 11, mirroring en's key structure exactly (including the _one/_other plural key pairs, per this file's existing convention across other namespaces).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This started as a task to extract the team-inbox feature from #530 onto a clean
develop. That premise turned out to be stale:developalready carries its own, more advanced team-inbox lineage (#521 merged, reverted, re-added via3fd19ba4f, then extended three more times through9238b2cb0— session handoff, collaborative work item threads — none of which #530 has). Porting #530's snapshot over that would have been a regression, not an extraction.So this PR does not port #530. It closes four real gaps found while diffing
develop's current team-inbox implementation against #530 and against itself:team_inbox_list_page/unread_count/mark_read/mark_all_read/mark_unreadhave existed in theproject-managementcrate and been called by the frontend since the post-feat(team-inbox): add unified team inbox #521-revert re-add, buthandler_list.incnever got the registration back. Every Team Inbox call has been rejecting at the Tauri boundary as an unknown command — the feature has been non-functional ondevelop.TeamInboxView'sreadAtguard protected its own handlers but not the coordinator itself, so any other caller could double-firemarkRead/markUnreadand trigger a redundant local/cloud round trip. Moved the guard intoteamInboxCoordinator.setReadState, checked against live cache state rather than a caller's snapshot.readAton failure, but nothing resynced the list/badge against server truth afterward, which risked drift if the revert raced another concurrent update. Extracted the success/failure/resync orchestration into a pure, framework-free helper (teamInboxReadTransitions.ts— repo policy is no.tsxunit tests) and wiredhandleSelect/handleMarkRead/handleMarkUnreadthrough it.aria-labelwas a hardcoded English template literal (now uses theteamInbox.unreadCountkey that already existed incommon.jsonbut was unused); theteamInboxnamespace itself only existed inen/zh— added to the other 11 shipped locales (de, es, fr, ja, ko, pl, pt, ru, tr, vi, zh-Hant), mirroringen's key structure.Checked and found already correct, no change needed:
markAllRead's unread-count bookkeeping already derives from the DB-wide bulk result and the server's mention-read response (not a loaded-page subtraction), anden/zhcommon.jsonhave no duplicateteamInboxkey or duplicateloadMorekey — those specific defects were unique to #530's history and aren't present ondevelop.Supersedes the team-inbox portion of #530.
Commits
fix(team-inbox): register orphaned IPC commandsfix(team-inbox): guard read-state idempotency in the coordinatorfix(team-inbox): revert and resync optimistic read state on failurefix(team-inbox): translate the unread sidebar badge aria-labelfeat(team-inbox): add teamInbox namespace to remaining localesValidation
tsc --noEmit --pretty false: cleanvitest run(TeamInbox + sidebar menu suites): 16 files, 89 tests passed, including 5 new tests for the read-transition helper and 2 new tests for the aria-label wiringeslint(all changed files): cleancargo check -p org2: passedcargo test -p project_management team_inbox --no-fail-fast: 14 passed, 0 failed