Skip to content

Add recents global nav action - #4012

Open
k11kirky wants to merge 4 commits into
mainfrom
posthog-code/add-recents-quick-action
Open

Add recents global nav action#4012
k11kirky wants to merge 4 commits into
mainfrom
posthog-code/add-recents-quick-action

Conversation

@k11kirky

@k11kirky k11kirky commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

Frequently revisited tasks and canvases need a fast, global way back without navigating through individual spaces.

Changes

  • Add a customizable Recents action to both global navigation layouts with the same hover-card behavior as Activity.
  • Show the 20 most recently viewed or actively used tasks and canvases, with direct navigation.
  • Persist engagement through PostHog's user-scoped desktop file-system view history so recents follow the signed-in user across clients.

Why: Recent work should remain one hover or click away wherever someone is in the app.

How did you test this?

  • Core recents and dashboard service unit tests
  • Sidebar and Channels nav component tests
  • Core, host-router, and UI typechecks
  • Desktop and web host typechecks
  • Biome checks and host-boundary validation

Automatic notifications

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

Created with PostHog Code

Generated-By: PostHog Code
Task-Id: f68869f0-4c94-4017-add1-ce18b6a323b3
@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

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 2dbf48b.

Generated-By: PostHog Code
Task-Id: f68869f0-4c94-4017-add1-ce18b6a323b3
@k11kirky
k11kirky marked this pull request as ready for review July 30, 2026 17:34
Comment on lines +23 to +27
const { mutate } = useMutation({
mutationFn: (input: RecentEngagementInput) =>
client.recents.record.mutate(input),
onSuccess: () =>
queryClient.invalidateQueries(trpc.recents.list.pathFilter()),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Recents failures lack diagnostics

Every engagement write uses a void, fire-and-forget mutation with no error handler, so authentication, connectivity, missing-canvas, and backend failures leave recent items absent without any user feedback or diagnostic signal.

Rule Used: Always wrap asynchronous calls that may fail, such... (source)

Learned From
PostHog/posthog#32098

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/ui/src/features/recents/useRecents.ts
Line: 23-27

Comment:
**Recents failures lack diagnostics**

Every engagement write uses a void, fire-and-forget mutation with no error handler, so authentication, connectivity, missing-canvas, and backend failures leave recent items absent without any user feedback or diagnostic signal.

**Rule Used:** Always wrap asynchronous calls that may fail, such... ([source](https://app.greptile.com/posthog-org-19734/-/custom-context?memory=df81f021-48c3-45e4-981f-7348133f5f7a))

**Learned From**
[PostHog/posthog#32098](https://github.com/PostHog/posthog/pull/32098)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment thread packages/core/src/recents/recentsService.ts
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
### Issue 1
packages/ui/src/features/recents/useRecents.ts:23-27
**Recents failures lack diagnostics**

Every engagement write uses a void, fire-and-forget mutation with no error handler, so authentication, connectivity, missing-canvas, and backend failures leave recent items absent without any user feedback or diagnostic signal.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "refactor: back recents with server engag..." | Re-trigger Greptile

@veria-ai

veria-ai Bot commented Jul 30, 2026

Copy link
Copy Markdown

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

k11kirky added 2 commits July 30, 2026 18:45
Generated-By: PostHog Code
Task-Id: f68869f0-4c94-4017-add1-ce18b6a323b3
Generated-By: PostHog Code
Task-Id: f68869f0-4c94-4017-add1-ce18b6a323b3
@posthog

posthog Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

👋 Visual changes detected for this PR.

Review and approve in PostHog Visual Review

If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix.

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.

1 participant