Skip to content

fix(spaces): make archiving a task remove it from the space - #3991

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/fix-spaces-archive-feed
Draft

fix(spaces): make archiving a task remove it from the space#3991
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/fix-spaces-archive-feed

Conversation

@posthog

@posthog posthog Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

Archiving a task in Spaces looked like it did nothing: two teammates reported that neither the row's archive icon nor the context-menu action removed the task — one saw only a brief toast.

Archiving is a local, per-device record (the cloud task list has no notion of it), so every surface that renders the channel feed has to filter archived tasks itself. The space's main feed — the Slack-style list of task cards, where past tasks live — rendered useChannelFeed's tasks raw. Archiving removed the sidebar row but left the card in the feed, and it came back on reload, so the archive read as a no-op.

Compounding it, a rejected archive in the space sidebar was swallowed by a bare void archiveTask(...): no row change, no toast, nothing.

Changes

  • useChannelFeed now drops archived tasks, so every space surface reading the feed hides them consistently (the sidebar list already did this via buildChannelItems).
  • A failed archive from the space sidebar now shows "Couldn't archive task" instead of failing silently.

How did you test this?

  • New useChannelFeed test: an archived task is dropped from the feed; ordering and the query cache are untouched. Verified it fails on the pre-fix code.
  • New useChannelItems tests: a rejected archive raises an error toast, a successful one stays quiet. Verified the failure case fails on the pre-fix code.
  • New coverage for both archive entry points: the row's archive icon (ChannelItemRow) and the row context menu's onArchive (ChannelSidebar).
  • pnpm exec vitest run src/features/canvas src/features/archive src/features/tasks src/features/sidebar — 69 files / 470 tests pass; pnpm --filter @posthog/ui typecheck clean; Biome clean.
  • Not exercised in a running desktop build (no signed-in app available in this environment) — the behaviour is pinned by the hook-level tests above.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Desktop from this inbox report.

Archiving is a local, per-device record, but the space feed rendered the cloud task list raw — so an archived task's card stayed in the feed (and survived reload) while only the sidebar row disappeared. Both archive entry points therefore looked like they did nothing beyond a toast.

The channel feed hook now drops archived tasks for every surface that reads it, and a rejected archive in the space sidebar shows an error toast instead of being swallowed by a bare `void`.

Generated-By: PostHog Code
Task-Id: 35aa501b-d1d6-44f7-8582-30183992f0fd
@trunk-io

trunk-io Bot commented Jul 30, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 717632e.

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.

0 participants