draft: feat: DAG Behavioral Changes (Canvas resource, Source Models, ... buttons)#8715
draft: feat: DAG Behavioral Changes (Canvas resource, Source Models, ... buttons)#8715
Conversation
royendo
left a comment
There was a problem hiding this comment.
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
20pxto16pxin the node - was this intentional? - Consider memoizing
handleViewGraphsince it accesses reactive stores
Otherwise the dropdown approach is much cleaner than the old toolbar!
Error case wraps in with error tooltip content
|
Needed to change some of the DAG behavior.




https://www.loom.com/share/a868526adb8347c4bd9009fa514967f6
Checklist: