Skip to content

FE-583: better petrinaut text wrapping#8623

Merged
alex-e-leon merged 7 commits intomainfrom
FE-583-better-petrinaut-text-wrapping
Apr 13, 2026
Merged

FE-583: better petrinaut text wrapping#8623
alex-e-leon merged 7 commits intomainfrom
FE-583-better-petrinaut-text-wrapping

Conversation

@alex-e-leon
Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Improves the text-wrapping functionality in petrinaut nodes.
I've broken this PR into 2 commits. The first is what I think are uncontroversial css changes that simply handles multi-line overflows + ellipsis better in the classic nodes.
The second is a new approach of handling the pascal case splitting that behaves slightly differently to the current implementations and I'm open to throwing away if its not liked. I'll explain the implementation + differences with some examples below:

Screenshot 2026-04-13 at 5 13 25 pm Screenshot 2026-04-13 at 5 12 50 pm

In the original version, we manually split pascal case into 2 lines. This means that if we have text that is too long, each individual line will ellipsify as in the first image. It also means that if we have a short pascal case it still splits into multiple lines.

In my new version, instead I add a zero width space between every pascal case character, which will then only break between pascal case characters if they do not fit on one line. If a very long word without a new pascal case section appears it uses overflow wrap to break anyway. Then uses line-clamp to keep the total max lines at 3 before ellipsifying.

The behaviour in most cases is identical, but how it handles very long words is slightly different.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an npm-publishable library and I have added a changeset file(s)

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Apr 13, 2026 5:21pm
petrinaut Ready Ready Preview, Comment Apr 13, 2026 5:21pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign Ignored Ignored Preview Apr 13, 2026 5:21pm
hashdotdesign-tokens Ignored Ignored Preview Apr 13, 2026 5:21pm

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 13, 2026

PR Summary

Low Risk
Low risk UI-only changes that adjust CSS and label rendering for node text; no logic changes beyond how labels are split/wrapped for display.

Overview
Improves text wrapping and truncation for long labels in Petrinaut classic nodes.

ClassicPlaceNode now inserts zero-width breakpoints between PascalCase segments and relies on overflowWrap + lineClamp to cap label height (plus minor padding/width tweaks) instead of rendering multiple separate label spans.

ClassicTransitionNode similarly applies word-breaking and a 2-line clamp to its label container, and a changeset bumps @hashintel/petrinaut with a patch release for the wrapping fix.

Reviewed by Cursor Bugbot for commit f31b9c2. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team labels Apr 13, 2026
@github-actions github-actions bot added the area/infra Relates to version control, CI, CD or IaC (area) label Apr 13, 2026
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Apr 13, 2026

🤖 Augment PR Summary

Summary: Improves text wrapping for Petrinaut classic SDCPN node labels, especially long PascalCase identifiers.

Key change: Adds addPascalCaseBreakPoints() to insert zero-width break opportunities at uppercase boundaries.

Updates Classic Place nodes to render the breakpointed label and adjust padding/width constraints to allow wrapping.

Applies multi-line clamping + word-breaking styles to reduce overflow and improve ellipsis behavior in place labels.

Adds wrapping/clamping styles to Classic Transition node content wrapper.

Why: Avoid forced 2-line PascalCase splits and reduce per-line truncation for long labels.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread libs/@hashintel/petrinaut/src/lib/split-pascal-case.ts Outdated
Comment thread libs/@hashintel/petrinaut/src/lib/split-pascal-case.ts Outdated
@vilkinsons vilkinsons changed the title Fe 583 better petrinaut text wrapping FE-583: better petrinaut text wrapping Apr 13, 2026
@graphite-app graphite-app bot requested review from a team April 13, 2026 15:40
kube
kube previously approved these changes Apr 13, 2026
Copy link
Copy Markdown
Collaborator

@kube kube left a comment

Choose a reason for hiding this comment

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

That is a better solution 👍

Comment thread libs/@hashintel/petrinaut/src/lib/split-pascal-case.ts Outdated
Comment thread libs/@hashintel/petrinaut/src/lib/split-pascal-case.ts Outdated
Comment thread libs/@hashintel/petrinaut/src/lib/split-pascal-case.ts Outdated
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 871f8d4. Configure here.

Copy link
Copy Markdown
Collaborator

@kube kube left a comment

Choose a reason for hiding this comment

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

👍

@alex-e-leon alex-e-leon enabled auto-merge April 13, 2026 17:19
@alex-e-leon alex-e-leon added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit ae168f5 Apr 13, 2026
44 checks passed
@alex-e-leon alex-e-leon deleted the FE-583-better-petrinaut-text-wrapping branch April 13, 2026 17:49
@hashdotai hashdotai mentioned this pull request Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

2 participants