Skip to content

fix(mcp): draw the logo a group's label names, before its name, when the diagram already draws logos - #537

Merged
graphite-app[bot] merged 1 commit into
mainfrom
fix/group-logo-fill
Oct 23, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
fix/group-logo-fill

Conversation

@anandpant

@anandpant anandpant commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

What

MCP flowchart builds now draw the logo a group's label names, before the group's name, when the diagram already draws logos. In Frontierclimb r23 (Sonnet, ai-app-stack-logos s4), the model drew Next.js, Redis, OpenAI and Sentry logos but left its "Vercel" group a bare name. That group now draws the Vercel mark.

Rule

Same terms as #519's node fill, MCP execute only (fillNamedLogos):

  • Fills a group whose label names exactly one catalog logo, distinctively (logoNamedByLabel).
  • Never fills:
    • a diagram whose nodes draw no logo;
    • labels naming several products or an everyday word ("GKE cluster (Kubernetes)", "Frontend", "Edge");
    • a group whose logo a node inside it already draws, nested groups included;
    • a group inside another group that already draws that logo (the outer one keeps it);
    • groups that hold no nodes and so aren't drawn.
  • Reports an icon_filled info note with ref: { kind: "group", id }.

Why the no-duplicate rule covers nodes inside the group only: a header logo that repeats a member's logo says nothing new inside the same box. A node outside the group with the same logo names its own product, so it doesn't block the fill. Across the corpus, no fill shares its slug with any drawn node anyway.

Rendering

Groups couldn't carry a logo anywhere before this PR (IR, renderer, scene, Excalidraw or PNG). This PR adds the smallest header logo consistent with node logos, 18 px:

  • Frame (plain group): inside the frame's top-left corner, 10 px in, under the frame's name. It is a frame child (frameId = the frame), so it moves with the frame in Excalidraw and Studio and isn't clipped. A frame's padding is at least 40 px (GROUP_PADDING), so members always clear the logo. The padded logo is a keep-out alongside the frame's name for routes, branch labels and marker room.
  • Zone: at the start of the header strip, with the label shifted after it. The zone widens to fit both. The logo shares the zone outline's groupIds, so the two move together.

API and model-facing surface

  • DiagramGroup.icon (core IR) and the canvas frame icon are new. A zone (rendererRole: "zone") may now carry an icon.
  • The FlowchartSpec group contract, guidance and prompts are unchanged; groups take no authored logo.
  • One generated-types line changes: the CanvasElement frame member gains icon?: { slug; size }. The fill has to survive the scene schema: the artifact viewer, patches, CLI and Studio all decode stored scenes through FrameSceneElement, which drops unknown keys. That text appears only in docs topics.
  • Generation drops any icon a model puts on a group, so /api/v1/generate stays unchanged.

Measured

Oct 17–23 Frontierclimb corpus: 5,434 specs replayed through Code Mode with MCP fill on, main against this branch.

  • Byte-identical: 5,073 of 5,434 in scene and Excalidraw. All 361 changed specs gained a group logo; nothing else changed.
  • Fills: 361, all checked by hand, every one on a diagram that already draws node logos (0 on logo-less diagrams):
    • "AWS cloud" → aws (208, hybrid-cloud zones)
    • "GKE cluster" → gke (147, kubernetes-cluster zones)
    • "Vercel" → vercel (5, ai-app-stack frames, including r23 s4)
    • "AWS · us-east-1" → aws (1, top-level region)
  • Collisions: none between a logo and a node, frame, route or text. No drawn node repeats a group's logo.
  • Placement: all 5 frame logos have their frame's frameId and sit inside it; all 356 zone logos sit inside their zone and share its group.
  • PNGs inspected for all four pairs; main's PNGs are identical apart from the logo.

Proof

  • Failing-first tests:
    • agent: frame and zone fills, the r23 s4 spec, and negatives for logo-less diagrams, multi-vendor and everyday-word labels, duplicates and host opt-in;
    • core: embedding, validation and header geometry;
    • generation: drops group icons.
  • pnpm nx affected -t typecheck,test,build, pnpm run check and build-storybook diagram-ui pass. New GroupLogo and ZoneLogo stories.

Copy link
Copy Markdown
Collaborator Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge - adds this PR to the back of the merge queue
  • fast - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Sketchi Icons Preview

Status: deleted

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Sketchi Web Preview

Status: deleted

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Sketchi Excalidraw Workspace Preview

Status: deleted

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Sketchi Eval Harness Preview

Status: deleted

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Sketchi Playground / Studio Preview

Status: deleted

@graphite-app

graphite-app Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Merge activity

…the diagram already draws logos (#537)

## What

MCP flowchart builds now draw the logo a group's label names, before the group's name, when the diagram already draws logos. In Frontierclimb r23 (Sonnet, ai-app-stack-logos s4), the model drew Next.js, Redis, OpenAI and Sentry logos but left its "Vercel" group a bare name. That group now draws the Vercel mark.

## Rule

Same terms as #519's node fill, MCP `execute` only (`fillNamedLogos`):

- **Fills** a group whose label names exactly one catalog logo, distinctively (`logoNamedByLabel`).
- **Never fills:**
  - a diagram whose nodes draw no logo;
  - labels naming several products or an everyday word ("GKE cluster (Kubernetes)", "Frontend", "Edge");
  - a group whose logo a node inside it already draws, nested groups included;
  - a group inside another group that already draws that logo (the outer one keeps it);
  - groups that hold no nodes and so aren't drawn.
- Reports an `icon_filled` info note with `ref: { kind: "group", id }`.

**Why the no-duplicate rule covers nodes inside the group only:** a header logo that repeats a member's logo says nothing new inside the same box. A node outside the group with the same logo names its own product, so it doesn't block the fill. Across the corpus, no fill shares its slug with any drawn node anyway.

## Rendering

Groups couldn't carry a logo anywhere before this PR (IR, renderer, scene, Excalidraw or PNG). This PR adds the smallest header logo consistent with node logos, 18 px:

- **Frame (plain group):** inside the frame's top-left corner, 10 px in, under the frame's name. It is a frame child (`frameId` = the frame), so it moves with the frame in Excalidraw and Studio and isn't clipped. A frame's padding is at least 40 px (`GROUP_PADDING`), so members always clear the logo. The padded logo is a keep-out alongside the frame's name for routes, branch labels and marker room.
- **Zone:** at the start of the header strip, with the label shifted after it. The zone widens to fit both. The logo shares the zone outline's `groupIds`, so the two move together.

## API and model-facing surface

- `DiagramGroup.icon` (core IR) and the canvas frame `icon` are new. A zone (`rendererRole: "zone"`) may now carry an `icon`.
- The `FlowchartSpec` group contract, guidance and prompts are unchanged; groups take no authored logo.
- **One generated-types line changes:** the `CanvasElement` frame member gains `icon?: { slug; size }`. The fill has to survive the scene schema: the artifact viewer, patches, CLI and Studio all decode stored scenes through `FrameSceneElement`, which drops unknown keys. That text appears only in docs topics.
- Generation drops any `icon` a model puts on a group, so `/api/v1/generate` stays unchanged.

## Measured

Oct 17–23 Frontierclimb corpus: 5,434 specs replayed through Code Mode with MCP fill on, main against this branch.

- **Byte-identical:** 5,073 of 5,434 in scene and Excalidraw. All 361 changed specs gained a group logo; nothing else changed.
- **Fills:** 361, all checked by hand, every one on a diagram that already draws node logos (0 on logo-less diagrams):
  - "AWS cloud" → `aws` (208, hybrid-cloud zones)
  - "GKE cluster" → `gke` (147, kubernetes-cluster zones)
  - "Vercel" → `vercel` (5, ai-app-stack frames, including r23 s4)
  - "AWS · us-east-1" → `aws` (1, top-level region)
- **Collisions:** none between a logo and a node, frame, route or text. No drawn node repeats a group's logo.
- **Placement:** all 5 frame logos have their frame's `frameId` and sit inside it; all 356 zone logos sit inside their zone and share its group.
- **PNGs inspected** for all four pairs; main's PNGs are identical apart from the logo.

## Proof

- Failing-first tests:
  - agent: frame and zone fills, the r23 s4 spec, and negatives for logo-less diagrams, multi-vendor and everyday-word labels, duplicates and host opt-in;
  - core: embedding, validation and header geometry;
  - generation: drops group icons.
- `pnpm nx affected -t typecheck,test,build`, `pnpm run check` and `build-storybook diagram-ui` pass. New `GroupLogo` and `ZoneLogo` stories.
@graphite-app
graphite-app Bot force-pushed the fix/group-logo-fill branch from 30f7227 to 5165f43 Compare October 23, 2026 21:30
@graphite-app
graphite-app Bot merged commit 5165f43 into main Oct 23, 2026
14 checks passed
@graphite-app
graphite-app Bot deployed to production October 23, 2026 21:32 Active
@graphite-app
graphite-app Bot deployed to production October 23, 2026 21:32 Active
@graphite-app
graphite-app Bot deployed to production October 23, 2026 21:32 Active
@graphite-app
graphite-app Bot deployed to production October 23, 2026 21:32 Active
@graphite-app
graphite-app Bot deployed to production October 23, 2026 21:32 Active
@graphite-app
graphite-app Bot deleted the fix/group-logo-fill branch October 23, 2026 21:32

This branch was successfully deployed

2 active deployments
staging — 5165f438 Deployed Oct 23, 2026 by graphite-app[bot] via cleanup-preview (playground) #968
production — 5165f438 Deployed Oct 23, 2026 by graphite-app[bot] via deploy (eval-harness) #222
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