-
Notifications
You must be signed in to change notification settings - Fork 123
FE-1635: Give the default canvas nodes the compact nodes' surface #9595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kube
merged 3 commits into
codex/fe-1708-petricon
from
claude/fe-1635-default-nodes-compact-styling
Sep 15, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@hashintel/petrinaut-core": patch | ||
| --- | ||
|
|
||
| `classicNodeDimensions` gives places a 104 × 104 footprint and transitions a 180 × 60 footprint for canvas rendering and layout. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@hashintel/petrinaut": patch | ||
| --- | ||
|
|
||
| Give default canvas nodes lighter colours, a soft shadow, a muted 1.5px outline, and matching name styling. Places are circular; transitions are rectangular with an icon on the left, a wrapped name, and the transition type. Preserve words in node names and align minimap nodes with their canvas positions and dimensions. |
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
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
49 changes: 49 additions & 0 deletions
49
libs/@hashintel/petrinaut/src/ui/lib/label-wrap-points.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { describe, expect, it } from "vitest"; | ||
|
|
||
| import { withLabelWrapPoints } from "./label-wrap-points"; | ||
|
|
||
| const ZERO_WIDTH_SPACE = "\u200B"; | ||
|
|
||
| const segments = (label: string): string[] => | ||
| withLabelWrapPoints(label).split(ZERO_WIDTH_SPACE); | ||
|
|
||
| describe("withLabelWrapPoints", () => { | ||
| it("breaks a PascalCase name between its words", () => { | ||
| expect(segments("HelloWorld")).toEqual(["Hello", "World"]); | ||
| }); | ||
|
|
||
| it("keeps an acronym together", () => { | ||
| expect(segments("QAQueue")).toEqual(["QA", "Queue"]); | ||
| expect(segments("XMLHttpRequest")).toEqual(["XML", "Http", "Request"]); | ||
| expect(segments("IOError")).toEqual(["IO", "Error"]); | ||
| }); | ||
|
|
||
| it("breaks before a run of digits", () => { | ||
| expect(segments("Space42")).toEqual(["Space", "42"]); | ||
| }); | ||
|
|
||
| it("leaves a single word alone", () => { | ||
| expect(segments("Hello")).toEqual(["Hello"]); | ||
| }); | ||
|
|
||
| it("leaves a label written as a sentence alone", () => { | ||
| for (const label of [ | ||
| "A motorway load is offered", | ||
| "Unload the tanker (SteadyNitrogen)", | ||
| "idle tankers", | ||
| ]) { | ||
| expect(withLabelWrapPoints(label).replace(/\u200B/gu, "")).toBe(label); | ||
| } | ||
| }); | ||
|
|
||
| it("still breaks the PascalCase parts of a sentence", () => { | ||
| expect(segments("Unload the tanker (SteadyNitrogen)")).toEqual([ | ||
| "Unload the tanker (Steady", | ||
| "Nitrogen)", | ||
| ]); | ||
| }); | ||
|
|
||
| it("returns an empty string unchanged", () => { | ||
| expect(withLabelWrapPoints("")).toBe(""); | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /** | ||
| * Inserts zero width spaces at a label's word boundaries, so a long name | ||
| * wraps inside a node instead of overflowing it. | ||
| * | ||
| * Boundaries are the PascalCase ones a browser will not break on its own: the | ||
| * start of a capitalised word, the start of a word after an acronym, and the | ||
| * start of a run of digits. Every other character is left as it is, so a label | ||
| * written as a sentence comes back untouched. | ||
| * | ||
| * "CriticalOxygenTank" wraps as Critical / Oxygen / Tank, "XMLHttpRequest" as | ||
| * XML / Http / Request, "Space42" as Space / 42. | ||
| */ | ||
| const WORD_BOUNDARY = | ||
| /(?<=[\p{Ll}\d])(?=\p{Lu})|(?<=\p{Lu})(?=\p{Lu}\p{Ll})|(?<=\p{L})(?=\d)/gu; | ||
|
|
||
| export const withLabelWrapPoints = (label: string): string => | ||
| label.replace(WORD_BOUNDARY, "\u200B"); |
101 changes: 0 additions & 101 deletions
101
libs/@hashintel/petrinaut/src/ui/lib/split-pascal-case.test.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.