Skip to content

feat: add copy-trace action to Task Details error banner#1257

Open
Subramaniyajothi6 wants to merge 3 commits into
utksh1:mainfrom
Subramaniyajothi6:feature/task-details-copy-stack-trace
Open

feat: add copy-trace action to Task Details error banner#1257
Subramaniyajothi6 wants to merge 3 commits into
utksh1:mainfrom
Subramaniyajothi6:feature/task-details-copy-stack-trace

Conversation

@Subramaniyajothi6

Copy link
Copy Markdown
Contributor

Closes #830

Summary

Adds a one-click copy action for the error trace on the Task Details page, and fixes a pre-existing CI regression that surfaced while doing this frontend work.

#830 — copy-trace action

The failed-task error banner (Critical_Execution_Fault) rendered task.error_message (the error / stack trace) with no way to copy it. Raw failure output already had a copy action via CopyToClipboard in the Raw Output tab, but the error trace did not.

  • CopyToClipboard (shared component): added optional label (default "Copy Output") and title props — backward compatible, so the existing Raw Output usage and its test are unchanged. Also disabled the button when there is nothing to copy (empty-state coherence, mirroring the existing "Copy ID" button).
  • TaskDetails: added a "Copy Trace" button to the error banner header for one-click copy of the error trace.
  • Added unit tests for the custom label and the disabled empty-state.

Incidental fix — Reports PDF button (unblocks frontend CI)

While running the frontend suite for this change, frontend-checks failed on pre-existing Reports tests, not on this feature. Root cause: #1205 added a client-side "PDF" export button next to the server-side export button, so two buttons shared the accessible name "PDF" and getByRole('button', { name: /^pdf$/i }) matched two elements. frontend-checks runs the full unit suite, so this red-flagged every frontend PR (it only surfaces when frontend files change — backend-only pushes skip the job).

  • Added an aria-label to the client-side PDF button so it no longer collides with the server-side export button. No visible UI change; also resolves the a11y issue of two identically named buttons in the same row.
  • Added a regression test asserting the two buttons stay distinct.

Verification

  • npm run typecheck — clean.
  • npm run quality — passes.
  • Full unit suite: 46/46 files, 401/401 tests green (the 12 pre-existing Reports failures are resolved).
  • Manually reasoned for desktop and narrow-width layouts; the copy button sits inline in the banner header and reuses the existing component styling.

Notes

@utksh1 Please review this pr and if there is any suggestion please comment it down

@Subramaniyajothi6

Copy link
Copy Markdown
Contributor Author

Heads-up: the two red checks here are pre-existing breakage on main, not this PR.

This PR is frontend-only and all frontend checks pass. backend-lint and Fresh-clone smoke test fail because the backend currently can't import on main, introduced by c5d1967 ("Redis-backed sliding window rate limiter"):

  1. backend/secuscan/routes.py:1862 — a stray comma makes the decorator invalid Python:
    @router.post("/workflows/{workflow_id}/run") , dependencies=[Depends(check_scan_rate_limit)]
    should be @router.post("/workflows/{workflow_id}/run", dependencies=[Depends(check_scan_rate_limit)])
  2. backend/secuscan/config.py — uses os.environ.get(...) but os is never imported (F821).

The syntax error stops the app from importing, so Fresh-clone smoke times out ("Backend did not become ready") and backend-lint fails on every open PR. Neither file is touched here, and this PR is synced to the latest main.

If you'd like me to fix this, then I'll open an issue and work on it.

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.

[FEAT] Add copy-stack-trace action in Task Details

1 participant