Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…graphy Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tore Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… edit mode Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Clear the kit hover when the pointer leaves the graph root (core emits no graph mouseleave there) and restore it on re-entry over the same target, where core emits no mouseenter. - Hide GraphTooltip while the context menu is open. - Release the pressed pointer on window blur and root pointercancel. - Drop the context-menu state when items() is empty or null and when the last GraphContextMenu unmounts, so it cannot reopen later. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- React block surfaces read the graph colors GraphCanvas mirrors (--graph-block-bg/-border/-border-selected) with uikit token fallbacks, so a colors override matches the canvas block on every level. - Resolve typography from the kit defaults instead of uikit's runtime TEXT_VARIANTS; getUikitTextStyle falls back to body-1 for unknown variants instead of crashing. - UikitConnection draws arrows with screen-pixel widths, skips the label pill when its text is too small to draw and re-renders on typography changes. - UikitBlock skips the description when no caption line fits. - Set graph colors before the palette in one batch, so palette subscribers see the new colors. - Fix the radius comment in UIKIT_GRAPH_CONSTANTS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- index.ts lists the documented API with explicit named exports; helpers
such as layout, entity and theme-resolution internals are no longer
exported. UikitGraphStore is exported as a type only.
- Deep-freeze the shared defaults (DEFAULT_UIKIT_PALETTE,
DEFAULT_UIKIT_TYPOGRAPHY, UIKIT_GRAPH_TOKENS, UIKIT_GRAPH_CONSTANTS) and
type them read-only; renderUikitText returns a new empty layout per
call.
- useUikitGraph({ tokens }) sets the uikit token table the theme is read
from (store $tokens, default UIKIT_GRAPH_TOKENS).
- Tag the palette and default block class as core candidates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and E2E - README: ThemeProvider is required; theme token table and the tokens option; how edit mode creates connections; unregistered block types fall back to core Block; prefer @types/react-beautiful-dnd over an ambient shim. - Contract: assert the uikit, react and react-dom peer ranges. - Storybook: scoped ThemeProvider that fills the viewport height. - E2E: the connection tooltip is anchored above the pointer (off-centre hover); switching view to edit at runtime enables anchor connections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Preview is ready. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ped group The group clips its children with overflow: hidden, and uikit draws the button focus ring outside the button box, so it was cut off (a lone action button got no ring at all). Draw it inside with uikit's public --g-button-focus-outline-offset and set an explicit ring color so it stays visible on brand-filled buttons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default reset title was "Actual size", so the accessible name did not contain the visible "1:1" label. Use "Actual size (1:1)" and update the unit tests, README and E2E. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…styles in the contract Fit selection, fit to viewport and 1:1 all end at scale 1 with the default blocks, so also assert that the selected block is centered in the viewport. Reword the misleading hit-box comment on the fit-to-viewport tolerance (it is rounding slack). The contract now checks that the toolbar group styles are shipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new v2 package,
@gravity-ui/graph-uikit, for building graphs inside@gravity-ui/uikitapplications. It has two layers:useUikitGraphandUikitGraphCanvas, which wire the whole kit in by default.Canvas rendering and LOD stay the core of the library. Every canvas level now gets the uikit look, and React is used only at the Detailed level.
Core (
packages/graph) is not modified. Code that should move into core is tagged// TODO(graph-core): <what> — <why>; see the list below.What's inside
Theme bridge. Graph colors follow the active uikit theme, with a global or scoped
ThemeProvider.UIKIT_GRAPH_TOKENS.useUikitGraph({ colors, tokens })overrides single values or the whole table.TGraphColorslive in a per-graph signal store.Canvas text.
renderUikitText/measureUikitTextmirror uikit<Text>: variants, colors,ellipsis,ellipsisLines,whiteSpace,wordBreak. The typography is built from the per-variant--g-text-*tokens.UikitBlock. A canvas block with a uikit surface on every LOD level:block.meta.theme, plusblock.meta.description.Override
renderContent(ctx, rect, level)for custom content.UikitConnection. Uikit line colors, screen-pixel line and arrow widths, and a uikit label pill.UikitGraphBlock. The Detailed-level React skeleton:GraphBlockwith a uikitBoxthat matches the canvas surface pixel for pixel. It respects thecolorsoverride.Interactions.
UikitInteractionLayer,GraphTooltip,GraphContextMenuanduseHoveredEntity, built on uikitPopup/Menu. They work on every LOD level, including React blocks.GraphContextMenuis mounted.Toolbar.
GraphUikitToolbaris a floating toolbar of uikit buttons grouped into cards.group(...zoomGroup({ reset, viewport, selection })): zoom in and out with a multiplicative step, 1:1, fit to viewport and fit selection.group(...)and custom actions.@gravity-ui/icons.Modes.
view/edit. Edit mode allows dragging blocks and creating connections through@gravity-ui/graph-connection-editing: Shift+drag between blocks, or anchor-to-anchor.Repo additions.
Plugins/Uikitstories (View, Edit, CustomBlock, four-theme switcher).apps/e2e/tests/uikit, includingtoolbar.spec.ts).Decisions worth knowing
tsconfig.publish.jsonusesskipLibCheck: true. uikit's declarations importreact-beautiful-dndtypes that uikit ships only as a devDependency (TS7016). The e2e and contract fixtures keepskipLibCheck: falseand use a small ambient type shim instead. The README tells consumers to install@types/react-beautiful-dnd..css) and notypes/node-esmfixture (uikit's own declarations fail under Node16).wordBreak: "break-all"behaves like"break-word";ellipsisLinestruncates the last kept line on its own, like CSS line-clamp.Core candidates (
grep -rn "TODO(graph-core)" packages/graph-uikit/src)mouseleavewhen the pointer leaves the root, and a graph-levelcontextmenuevent.Block.layoutText;"500 13px"becomes 50013;measureTextcache is never cleared.TGraphColorsgroups.Testing
pnpm run build.typecheckandlintare clean.test:type-configsandtest:release-contract.pnpm --filter @gravity-ui/graph-e2e run test:e2e tests/uikit) and the package contract (pnpm --filter @gravity-ui/graph-uikit run test:package-contract). The dev sandbox blocked local port binding and registry access.🤖 Generated with Claude Code