Skip to content

fix: preserve workspace label when creating DAGs#2096

Merged
yottahmd merged 1 commit intomainfrom
codex/fix-workspace-new-dag
May 6, 2026
Merged

fix: preserve workspace label when creating DAGs#2096
yottahmd merged 1 commit intomainfrom
codex/fix-workspace-new-dag

Conversation

@yottahmd
Copy link
Copy Markdown
Collaborator

@yottahmd yottahmd commented May 6, 2026

Summary

  • Add the selected workspace label to DAGs created from the Workflows header New button.
  • Add a regression test for the selected-workspace create payload.
  • Fix dialog accessibility/DOM warnings uncovered while validating the create flow.

Root cause

The header create path posted only the DAG name, unlike the empty-state create path that initialized the spec with the selected workspace label. New DAGs created from the header were therefore treated as default-workspace DAGs and failed the selected-workspace check.

Tests

  • pnpm vitest run src/features/dags/components/common/__tests__/CreateDAGButton.test.tsx
  • pnpm vitest run src/features/dags/components/dag-execution/__tests__/StartDAGModal.test.tsx
  • pnpm vitest run src/pages/agent-settings/__tests__/ModelFormModal.test.tsx
  • pnpm typecheck
  • pnpm test
  • pnpm build

Summary by CodeRabbit

Release Notes

  • New Features
    • Workspace-aware default specifications are now automatically included when creating DAGs
  • Accessibility
    • Improved screen reader support for DAG execution and model configuration modals
  • UI Updates
    • Refined DAG name input modal layout for better organization
  • Tests
    • Added comprehensive test coverage for DAG creation with workspace configurations

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 084377bd-ded7-4a15-8e28-965e7477fe74

📥 Commits

Reviewing files that changed from the base of the PR and between 1808c70 and c79e0a9.

📒 Files selected for processing (5)
  • ui/src/components/DAGNameInputModal.tsx
  • ui/src/features/dags/components/common/CreateDAGButton.tsx
  • ui/src/features/dags/components/common/__tests__/CreateDAGButton.test.tsx
  • ui/src/features/dags/components/dag-execution/StartDAGModal.tsx
  • ui/src/pages/agent-settings/ModelFormModal.tsx

📝 Walkthrough

Walkthrough

This PR adds workspace-aware default DAG spec logic to the DAG creation flow, improves accessibility by adding screen-reader descriptions to multiple dialog components, and restructures the DAGNameInputModal layout to move the pattern hint outside the description block. A new test suite validates the workspace-aware DAG creation behavior.

Changes

Workspace-aware DAG Creation

Layer / File(s) Summary
Dependencies & Imports
ui/src/features/dags/components/common/CreateDAGButton.tsx (lines 13–17)
Imported defaultDAGSpec from dagSpec utilities and workspace helpers (sanitizeWorkspaceSelection, WorkspaceKind).
Core Implementation
ui/src/features/dags/components/common/CreateDAGButton.tsx (lines 30–60)
Compute sanitized workspace selection from app bar context; conditionally include spec field in DAG creation POST payload when a workspace is selected, using defaultDAGSpec(workspace).
Tests
ui/src/features/dags/components/common/__tests__/CreateDAGButton.test.tsx
New test suite mocks API calls and app context, renders CreateDAGButton within AppBarContext, simulates DAG creation with workspace selection, and asserts correct POST to /dags with spec containing workspace information.

Dialog Accessibility & UI Improvements

Layer / File(s) Summary
DAG Name Modal Restructuring
ui/src/components/DAGNameInputModal.tsx (lines 122–129)
Moved Pattern hint from inside DialogDescription to a separate block after DialogDescription within DialogHeader; updated CSS class to text-muted-foreground for styling.
Start DAG Modal Accessibility
ui/src/features/dags/components/dag-execution/StartDAGModal.tsx (lines 15–19, 473–478)
Added import of DialogDescription and inserted a hidden sr-only description ("Configure the DAG run before submitting it.") beneath DialogTitle for screen-reader accessibility.
Model Settings Modal Accessibility
ui/src/pages/agent-settings/ModelFormModal.tsx (lines 16–22, 250–252)
Added import of DialogDescription and inserted a hidden sr-only description ("Configure the model settings used by the agent.") in DialogHeader for accessibility.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • dagucloud/dagu#2039: Modifies the same StartDAGModal component to add schema-backed parameter form logic alongside this PR's accessibility improvements.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: preserve workspace label when creating DAGs' directly describes the main functional fix—ensuring the selected workspace label is included when creating DAGs via the header button. This is the primary change across the modified files.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 codex/fix-workspace-new-dag

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 and usage tips.

@yottahmd yottahmd merged commit 0f68cd3 into main May 6, 2026
9 checks passed
@yottahmd yottahmd deleted the codex/fix-workspace-new-dag branch May 6, 2026 08:18
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