Skip to content

feat(logs): add copy link and deep-link support for log entries#3863

Merged
waleedlatif1 merged 3 commits intostagingfrom
feat/log-link
Mar 31, 2026
Merged

feat(logs): add copy link and deep-link support for log entries#3863
waleedlatif1 merged 3 commits intostagingfrom
feat/log-link

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Added "Copy Link" to the log row context menu — copies a URL with ?executionId= that deep-links directly to the specific log
  • Opening a deep link auto-selects the log and expands the details panel; paginator walks through pages until the target execution is found
  • Replaced ?search= with ?executionId= in notification delivery URLs (email + Slack "View Log" buttons) so they open the log directly
  • Eliminated 6 unnecessary useEffect ref-sync effects by assigning refs inline during render
  • Fixed several edge cases in the deep-link pagination effect: premature ref clear before query initializes, stale isFetching ref in deps, and calling fetchNextPage before query succeeds

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Switch buildLogUrl from ?search= to ?executionId= so email and Slack
'View Log' buttons open the logs page with the specific execution
auto-selected and the details panel expanded.
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 31, 2026 4:17am

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Mar 31, 2026

PR Summary

Low Risk
Low risk: a small URL/query-parameter change limited to notification link generation (email/Slack) with no data handling or auth logic changes.

Overview
Notification delivery now builds log URLs using ?executionId= instead of ?search= in buildLogUrl, so email and Slack "View Log" buttons deep-link directly to the specific execution log entry.

Written by Cursor Bugbot for commit aa4f229. Configure here.

@waleedlatif1 waleedlatif1 merged commit d091441 into staging Mar 31, 2026
7 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/log-link branch March 31, 2026 04:18
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 31, 2026

Greptile Summary

This PR completes the "deep-link" log feature by updating the workspace notification delivery service to generate ?executionId=<id> URLs instead of ?search=<id> URLs for the "View Log" buttons in outgoing email and Slack alerts. The bulk of the feature (the client-side deep-link navigation, pagination loop, "Copy Link" context menu item, and icon migration) was already merged in the prior commit e9c94fa46 against the staging branch; this PR adds the server-side notification counterpart as a single follow-up commit.

Key changes:

  • buildLogUrl in workspace-notification-delivery.ts switches from ?search= to ?executionId= so notification links open the logs page with the targeted entry auto-selected and the details panel expanded, rather than just populating the search box.
  • The logs page already reads ?executionId= at mount time and walks through infinite-scroll pages until the target log is found, so no front-end changes are required in this PR.
  • ?search= remains functional (it still populates the search bar), so existing bookmarks are not broken.

Confidence Score: 5/5

Safe to merge — single-line change with no logic risk and a well-tested front-end counterpart already in staging.

The effective diff is one line: renaming the URL query parameter from ?search= to ?executionId= in buildLogUrl. The front-end already handles ?executionId= correctly (deep-link pagination loop) and ?search= still works for the search bar, so there are no breaking changes. No new logic paths, no data mutations, and no auth surface changes are introduced.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/background/workspace-notification-delivery.ts Single-line change to buildLogUrl: switches query parameter from ?search= to ?executionId= so email and Slack "View Log" buttons use the new deep-link format. Change is correct and both callers (deliverEmail, deliverSlack) are unaffected.

Sequence Diagram

sequenceDiagram
    participant TriggerDev as Trigger.dev Task
    participant Delivery as workspace-notification-delivery.ts
    participant Email as Email / Slack
    participant User as User (clicks link)
    participant LogsPage as /logs page (logs.tsx)

    TriggerDev->>Delivery: executeNotificationDelivery(params)
    Delivery->>Delivery: buildLogUrl(workspaceId, executionId)<br/>→ ?executionId=<id>
    Delivery->>Email: send email/Slack with logUrl

    User->>LogsPage: GET /workspace/:id/logs?executionId=<id>
    LogsPage->>LogsPage: read ?executionId param<br/>pendingExecutionIdRef = id
    LogsPage->>LogsPage: initializeFromURL() → enable logsQuery
    loop pagination until found
        LogsPage->>LogsPage: search sortedLogs for executionId
        alt found
            LogsPage->>LogsPage: dispatch TOGGLE_LOG → open sidebar
        else not found, hasNextPage
            LogsPage->>LogsPage: fetchNextPage()
        else exhausted
            LogsPage->>LogsPage: clear pendingExecutionIdRef
        end
    end
Loading

Reviews (1): Last reviewed commit: "feat(notifications): use executionId dee..." | Re-trigger Greptile

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