Skip to content

fix: copy DAG and document name instead of absolute file path - #2509

Merged
yohamta0 merged 4 commits into
mainfrom
fix/copy-dag-doc-name
Aug 6, 2026
Merged

yohamta0 merged 4 commits into
mainfrom
fix/copy-dag-doc-name

Conversation

@yohamta0

@yohamta0 yohamta0 commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Summary

The copy button next to the DAG title and the document title copied the absolute file path on disk. It now copies the name shown next to it.

  • DAGHeader: copies the displayed DAG name (dagRun.name || dag.name), tooltip Copy name: <name>, adds aria-label="Copy name".
  • DocEditor: copies the document name (doc.title, falling back to the doc path basename). The button is no longer gated on the response carrying a file path.

API

With the UI no longer consuming it, the absolute-path field is dropped from the HTTP surface:

  • GET /dags/{fileName} response: filePath removed
  • DAGFile (DAG list): filePath removed
  • DocResponse: filePath removed

SyncItem.filePath / SyncItemDiffResponse.filePath are untouched — those are relative paths that identify a sync item, not disk paths.

Domain models keep their locations (dag.Location, docs.Doc.FilePath); only the API stopped exposing absolute paths.

Breaking: external REST/MCP clients reading filePath from DAG list, DAG details, or doc responses no longer receive it. Nothing in this repo consumed it.

Notes

api/v1/api.gen.go was regenerated with oapi-codegen v2.5.1 — the version stamped in the checked-in file. make api currently fails before generating, on a pre-existing spec validation error also present on main:

Validation error: invalid components: schema "DAG": extra sibling fields: [description]

Test plan

  • go build ./..., go vet, gofmt -l clean
  • go test ./internal/service/frontend/api/v1/ passes
  • pnpm typecheck clean for touched files
  • pnpm vitest run over dag-details, dags/dag, docs: 17 files / 72 tests pass

Summary by cubic

Fixes the copy buttons next to DAG and document titles to copy the displayed name instead of the absolute disk path, with more robust clipboard handling and accessible feedback. Removes absolute filePath from public API responses and the docs domain model to avoid leaking disk paths.

  • Bug Fixes

    • DAGHeader: copies the displayed DAG name (dagRun.name || dag.name), tooltip "Copy name: ", adds aria-label="Copy name", scopes the copied indicator to the exact name, uses copyText with a secure-context fallback, and cleans up timers.
    • DocEditor: copies the document name (doc.title, falling back to the path basename); button no longer depends on an absolute file path; adds aria-live feedback scoped to the copied name; uses copyText and cleans up timers.
  • Migration

    • Removed filePath from GET /dags/{fileName} response, DAGFile in DAG list, and DocResponse.
    • Dropped docs.Doc.FilePath from the domain model; dag.Location remains.
    • Update clients to use the displayed name (dagRun.name || dag.name) or doc.title for copy/actions. SyncItem.filePath (relative) is unchanged.

Written for commit 1e707d6. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Improvements
    • Removed absolute file paths from DAG and document API responses.
    • DAG and document headers now copy the displayed name or title instead of a file path.
    • Added clearer copy-button behavior and accessibility feedback.
  • Bug Fixes
    • Updated DAG and document views to work correctly without file-path metadata.
  • Tests
    • Updated related test scenarios and fixtures to reflect the revised response data.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7bb15256-c7ba-4efe-9018-96a04b7069de

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

File path metadata removal

Layer / File(s) Summary
API contract and generated models
api/v1/api.yaml, api/v1/api.gen.go, ui/src/api/v1/schema.ts
DAG and document API schemas and generated models no longer define filePath. The embedded Swagger payload was regenerated.
Backend response mappings
internal/service/frontend/api/v1/dags.go, internal/service/frontend/api/v1/docs_response.go, internal/service/frontend/api/v1/dags_test.go
DAG and document responses no longer populate file paths. Related tests no longer assert those fields.
Frontend display behavior
ui/src/features/dags/components/dag-details/*, ui/src/pages/dags/dag/index.tsx, ui/src/pages/docs/components/DocEditor.tsx, ui/src/**/__tests__/*
DAG and document headers copy names or titles instead of file paths. Frontend props, response types, fixtures, labels, and copied-state handling were updated.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main UI change: copying DAG and document names instead of absolute file paths.
Description check ✅ Passed The description explains the UI and API changes, breaking impact, regeneration note, and test results, but omits the template checklist and related issues section.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/copy-dag-doc-name

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui/src/features/dags/components/dag-details/DAGHeader.tsx`:
- Around line 38-66: Update the copied-state logic in DAGHeader’s copyName flow
to track the copied name rather than a boolean, and retain the timeout handle in
a ref so each new copy clears the previous timeout before scheduling another.
Ensure the copied feedback only remains associated with the name most recently
copied and resets after the timeout.
- Around line 235-242: Update the copy button’s accessibility feedback in the
displayName block and copiedName state so assistive technology announces
successful copying: use a dynamic aria-label reflecting the copied state or add
an aria-live status, while preserving the existing “Copy name” label before
copying.
- Around line 56-64: Update the fallback copy handling in the catch path to
track the boolean result of document.execCommand('copy'), clean up the temporary
textarea in a finally block, and return without calling setCopiedName when
copying fails. Only setCopiedName(true) and schedule its reset after a
successful fallback copy.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e1df753-0b3d-484e-b846-9bf7f4d5743d

📥 Commits

Reviewing files that changed from the base of the PR and between 492c833 and 7ee6f46.

📒 Files selected for processing (16)
  • api/v1/api.gen.go
  • api/v1/api.yaml
  • internal/service/frontend/api/v1/dags.go
  • internal/service/frontend/api/v1/dags_test.go
  • internal/service/frontend/api/v1/docs_response.go
  • ui/src/api/v1/schema.ts
  • ui/src/features/dags/components/dag-details/DAGDetailsContent.tsx
  • ui/src/features/dags/components/dag-details/DAGDetailsPanel.tsx
  • ui/src/features/dags/components/dag-details/DAGDetailsSidePanel.tsx
  • ui/src/features/dags/components/dag-details/DAGHeader.tsx
  • ui/src/features/dags/components/dag-details/__tests__/DAGDetailsPanel.test.tsx
  • ui/src/features/dags/components/dag-details/__tests__/DAGDetailsSidePanel.test.tsx
  • ui/src/pages/dags/dag/__tests__/index.test.tsx
  • ui/src/pages/dags/dag/index.tsx
  • ui/src/pages/docs/components/DocEditor.tsx
  • ui/src/pages/docs/components/__tests__/DocEditor.test.tsx
💤 Files with no reviewable changes (13)
  • ui/src/pages/dags/dag/index.tsx
  • ui/src/features/dags/components/dag-details/tests/DAGDetailsSidePanel.test.tsx
  • ui/src/features/dags/components/dag-details/DAGDetailsPanel.tsx
  • internal/service/frontend/api/v1/docs_response.go
  • ui/src/features/dags/components/dag-details/DAGDetailsSidePanel.tsx
  • ui/src/pages/dags/dag/tests/index.test.tsx
  • ui/src/features/dags/components/dag-details/tests/DAGDetailsPanel.test.tsx
  • ui/src/features/dags/components/dag-details/DAGDetailsContent.tsx
  • ui/src/pages/docs/components/tests/DocEditor.test.tsx
  • internal/service/frontend/api/v1/dags.go
  • api/v1/api.yaml
  • internal/service/frontend/api/v1/dags_test.go
  • ui/src/api/v1/schema.ts

Comment thread ui/src/features/dags/components/dag-details/DAGHeader.tsx Outdated
Comment thread ui/src/features/dags/components/dag-details/DAGHeader.tsx Outdated
Comment thread ui/src/features/dags/components/dag-details/DAGHeader.tsx Outdated
@yohamta0
yohamta0 merged commit 61bf24a into main Aug 6, 2026
14 checks passed
@yohamta0
yohamta0 deleted the fix/copy-dag-doc-name branch August 6, 2026 09:31
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