Repository navigation
fix(app-shell): a deleted record leaves the recently-accessed list - #34108
Conversation
Claude-Session: https://claude.ai/code/session_01ADHkmTS7jKcrSq1mgNofuy Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmTS7jKcrSq1mgNofuy Co-authored-by: Claude <noreply@anthropic.com>
…ting removeRecentItem Claude-Session: https://claude.ai/code/session_01ADHkmTS7jKcrSq1mgNofuy Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmTS7jKcrSq1mgNofuy Co-authored-by: Claude <noreply@anthropic.com>
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi 维护者速读
席位意见从数据源删除事件统一入手,而非在每个删除入口各加一行,属于根因修法。遗留两点已在 PR 写明并由席位承接:批量删除事件不带 id(需扩 席位核对 — ACCEPT · domain:ui#2 · head a6cbed1 · 2026-11-15T19:38Z |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43756689931 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Steve · project thread
Fixes #33826
Clause-②: no
Metadata-protocol: none
维护者速读
ui.recent偏好同步)。record:对象:ID这一条;回滚即 revert 本 PR,无数据迁移。ui/packages/app-shell/src/context/RecentItemsProvider.tsx(useDropDeletedRecordsFromRecents)→ui/packages/app-shell/src/console/ConsoleShell.tsx(唯一挂载点)。What changes
useDropDeletedRecordsFromRecents(dataSource)(new, module-internal to@object-ui/app-shell, not exported from the package index): subscribes to the data source'sonMutationand, on adeleteevent that names its record (resource+id), calls the provider's existingremoveRecentItemwith the record entry's id,record:OBJECT:RECORD_ID(the id the record page writes).removeRecentItemalready writes the list, localStorage and the debouncedui.recentsave, and writes nothing when the entry is absent.ConnectedShellInnermounts it once (DeletedRecordsLeaveRecents, besideUserStateBridge), on the connected adapter. The console'sConsoleShellholdsRecentItemsProviderabove everyConnectedShell, so the palette (CommandPalette), Home and the sidebar read the trimmed list. One subscriber covers every delete door that reports its record (record header, list row, action) with no call at each door, andRecordDetailView.tsxis untouched.addRecentItemeffect. A restore emits no mutation event by design (restoreRecycleBinEntry: "a restore is never a create"), so nothing re-inserts the entry before the visit.useRecentItems()value and the package exports are unchanged, soClause-②: noholds.Tests
ui/packages/app-shell/src/context/__tests__/RecentItemsProvider.test.tsxgains one top-leveldescribe(the shared harness file): the deleted record leaves the list, localStorage and the saved row; CONTROL another record's delete (same object, other object) leaves it listed and saves nothing; CONTROL anupdateevent and an id-lessdelete(bulk) drop nothing; after an undo the revisit lists it again at the head; the listener unsubscribes on unmount.ui/packages/app-shell/src/console/__tests__/ConnectedShell.deletedRecordLeavesRecents-33826.test.tsx(new): the realConnectedShellunder the real recents provider; a delete reported by the adapter drops that record only; the subscription goes away with the shell.Test runs (head a6cbed1)
pnpm --dir ui exec vitest run packages/app-shell/src/context/__tests__/RecentItemsProvider.test.tsx packages/app-shell/src/console/__tests__/ConnectedShell.deletedRecordLeavesRecents-33826.test.tsx: Test Files 2 passed (2), Tests 28 passed (28), lock VERDICT command-exit 0.scripts/ablation-replace.mjs, mutation landed anchor 1 to 0, restored blob == HEAD):DeletedRecordsLeaveRecentsmount deleted fromConsoleShell.tsxturns the shell pin red, Tests 2 failed (2).removeRecentItem(recordRecentItemId(...))call in the hook replaced by a no-op turns 3 pins red (deleted record gone; undo revisit; shell drop), Tests 3 failed / 25 passed (28); restored,git diff HEADempty.@object-ui/*tosrc/throughui/vitest.config.mtsaliases.Acceptance notes
bulkDelete,bulk('delete')) emits one resource-leveldeletewith noid, so its records stay in the recents until opened. Closing it needs the mutation event to carry the deleted ids (DataSourceMutationEventin@object-ui/types), a public-type widening outside this card's surface. carrier: seat (named in the report's open_questions).RecordDetailView.tsx), which this card's claim fenced off; not done here. carrier: seat.Verification
Local gates (head a6cbed1)
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 37 commands, each run, all exit 0 (includingpnpm --dir ui exec vitest run scripts/under the lock,pnpm check:test-source-alias,pnpm check:cross-package-test-inputs,pnpm check:nul-bytes,pnpm check:published-files).--ranreconciliation: 37 derived, 37 run, 0 NOT-MEASURED, 0 UNRUN.pnpm --filter @object-ui/app-shell type-check(afterturbo run build --filter='@object-ui/app-shell^...'): bothtsc --noEmitandtsc -p tsconfig.test.json, lock VERDICT command-exit 0.pnpm --dir ui run check:new-line-citations: 0 new citations.Generated by Claude Code