feat(logs): add copy link and deep link support for log entries#3855
feat(logs): add copy link and deep link support for log entries#3855waleedlatif1 merged 6 commits intostagingfrom
Conversation
PR SummaryMedium Risk Overview The logs page now reads an Written by Cursor Bugbot for commit 48bdbe5. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds "Copy Link" / deep-link support to the logs view: a new context-menu item copies a shareable URL with A nice secondary cleanup landed alongside the feature: six ref-sync All five P1 issues raised in earlier review rounds have been correctly resolved in this final commit — the
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant ContextMenu as LogRowContextMenu
participant Logs as logs.tsx
participant Clipboard as Clipboard API
participant TanStack as TanStack Query
User->>ContextMenu: Right-click log row
ContextMenu->>User: Show context menu
User->>ContextMenu: Click "Copy Link"
ContextMenu->>Logs: onCopyLink()
Logs->>Clipboard: writeText(url with ?executionId=)
Clipboard-->>Logs: resolved/.catch(()=>{})
Note over User,TanStack: Opening a deep link
User->>Logs: Navigate to ?executionId=XYZ
Logs->>Logs: useEffect[] sets pendingExecutionIdRef = XYZ
Logs->>TanStack: isInitialized → enables query
TanStack-->>Logs: status='success', sortedLogs updated
loop Until found or exhausted
Logs->>Logs: deep-link effect: search sortedLogs for XYZ
alt found
Logs->>Logs: dispatch TOGGLE_LOG, clear ref
else hasNextPage && !isFetching && status=success
Logs->>TanStack: fetchNextPage()
TanStack-->>Logs: next page loaded
else !hasNextPage && status=success
Logs->>Logs: clear ref (not found)
end
end
Reviews (5): Last reviewed commit: "fix(logs): guard fetchNextPage call unti..." | Re-trigger Greptile |
...im/app/workspace/[workspaceId]/logs/components/log-row-context-menu/log-row-context-menu.tsx
Outdated
Show resolved
Hide resolved
|
@greptile |
|
@cursor review |
- Remove guard that prevented clearing the pending ref when filters return no results - Use directly in the condition and add it to the effect deps so the effect re-triggers after a background refetch
|
@greptile |
|
@cursor review |
Only clear pendingExecutionIdRef when the query status is 'success', preventing premature clearing before the initial fetch completes. On mount, the query is disabled (isInitialized.current starts false), so hasNextPage is false but no data has loaded yet — the ref was being cleared in the same effect pass that set it.
|
@greptile |
|
@cursor review |
Add logsQuery.status === 'success' to the fetchNextPage branch so it mirrors the clear branch. On mount the query is disabled (isFetching is false, status is pending), causing the effect to call fetchNextPage() before the query is initialized — now both branches require success.
|
@greptile |
|
@cursor review |
Summary
Type of Change
Testing
Tested manually
Checklist