Skip to content

draft: feat: DAG Behavioral Changes (Canvas resource, Source Models, ... buttons)#8715

Draft
royendo wants to merge 22 commits intomainfrom
feat/dag-changes
Draft

draft: feat: DAG Behavioral Changes (Canvas resource, Source Models, ... buttons)#8715
royendo wants to merge 22 commits intomainfrom
feat/dag-changes

Conversation

@royendo
Copy link
Contributor

@royendo royendo commented Jan 28, 2026

Needed to change some of the DAG behavior.
https://www.loom.com/share/a868526adb8347c4bd9009fa514967f6
Screenshot 2026-02-06 at 17 32 07
Screenshot 2026-02-06 at 17 32 34
Screenshot 2026-02-06 at 17 32 21
Screenshot 2026-02-06 at 17 32 14

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Copy link
Contributor Author

@royendo royendo left a comment

Choose a reason for hiding this comment

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

Code Review - DAG Nit Behavioral Fixes

Good UX improvements with the dropdown menu replacing the old toolbar. Here's my feedback:

Issues to Address

1. ResourceNode.svelte - Code duplication
The node markup is duplicated for error vs non-error cases (lines ~134-230 and ~240-330). This makes maintenance harder. Consider extracting the common parts:

<!-- Common node wrapper -->
{#snippet nodeContent()}
  <Handle ... />
  <Handle ... />
  {#if !isInOverlay}
    <div class="node-menu">...</div>
  {/if}
  <div class="icon-wrapper">...</div>
  <div class="details">...</div>
{/snippet}

{#if hasError}
  <Tooltip>
    <div class="node" ...>
      {@render nodeContent()}
    </div>
    <TooltipContent>...</TooltipContent>
  </Tooltip>
{:else}
  <div class="node" ...>
    {@render nodeContent()}
  </div>
{/if}

2. ResourceNode.svelte - Import formatting (line ~17)

import { GitFork } from "lucide-svelte";
  import { builderActions, getAttrs } from "bits-ui";

The GitFork import has inconsistent indentation.

3. ResourceNode.svelte - Unused import
NodeToolbar is still in the imports but was removed from usage. Clean this up.

4. ResourceNode.svelte - handleRefresh doesn't show feedback

function handleRefresh(e?: MouseEvent) {
    e?.stopPropagation();
    if (!isModel || !data?.resource?.meta?.name?.name) return;
    void $triggerMutation.mutateAsync({...});
}

Consider adding loading state or toast notification so users know the refresh was triggered.

5. GraphCanvas.svelte - Global CSS selector

:global(.svelte-flow .svelte-flow__pane) {
    background-color: var(--surface-background, #ffffff);
}

This could unintentionally affect other xyflow instances in the app. Consider scoping it more specifically or using a data attribute.

Minor Suggestions

  • The icon size changed from 20px to 16px in the node - was this intentional?
  • Consider memoizing handleViewGraph since it accesses reactive stores

Otherwise the dropdown approach is much cleaner than the old toolbar!

@royendo
Copy link
Contributor Author

royendo commented Jan 28, 2026

  1. Code Duplication - I'd recommend accepting the duplication as a Svelte 4 limitation. The differences between the two branches are:

Error case wraps in with error tooltip content
Error case always shows status, non-error only shows if effectiveStatusLabel is truthy
Extracting to a child component would add complexity (passing many props, handling slots) for minimal benefit. The duplication is easy to maintain since changes are typically made to both blocks together.

  1. Icon Size (16px) - This is intentional for the compact dropdown-based design. The node itself is more compact now, so smaller icons fit better.

  2. handleViewGraph - Correct, no memoization needed. It's an event handler that reads current reactive values at click time, not a computed value that needs caching.

@royendo royendo changed the title feat: nit dag changes feat: DAG Behavioral Changes (Canvas resource, Source Models, ... buttons) Jan 28, 2026
@royendo royendo changed the title feat: DAG Behavioral Changes (Canvas resource, Source Models, ... buttons) draft: feat: DAG Behavioral Changes (Canvas resource, Source Models, ... buttons) Feb 4, 2026
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