Skip to content

H-6720: Remove Petrinaut branding from the AI panel and use HASH breadcrumbs in the process editor - #9084

Merged
vilkinsons merged 6 commits into
mainfrom
claude/h-6720-hash-embed-debranding-breadcrumbs
Jul 22, 2026
Merged

H-6720: Remove Petrinaut branding from the AI panel and use HASH breadcrumbs in the process editor#9084
vilkinsons merged 6 commits into
mainfrom
claude/h-6720-hash-embed-debranding-breadcrumbs

Conversation

@claude

@claude claude Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Requested by Dei Vilkinsons · Slack thread

🌟 What is the purpose of this PR?

First pass at making Petrinaut feel native when embedded in HASH, for Dei Vilkinsons (UX check) and Chris Feijoo (Petrinaut FE) to review.

Before → After, in plain language:

  1. AI assistant panel — the panel's tab said "Petrinaut AI" and the empty state read "Ask Petrinaut AI to create a Petri net, explain or revise the current model." The tab now says "AI" and the empty state reads "Ask AI to create a Petri net, explain or revise the current model." Per Ciaran's direction in the thread, the strings were removed outright everywhere (no host-specific branding knob), so the standalone petrinaut-website shows the same neutral wording.
  2. Process page top bar — the embedded editor showed the process title with a <- back-arrow icon. It now shows HASH-style breadcrumbs integrated into Petrinaut's own top bar (single bar, per Dei's follow-up feedback): sidebar-toggle and menu buttons, then a Processes crumb (with the sidebar's chart-network icon) and the editor's existing editable title as the final crumb. Colors match HASH's entity breadcrumbs per Dei's spec: crumb text, its icon and the title in #677789, the chevron separator in #95a5b8. The model name appears once, "Processes" navigates back to the list, and the back arrow is gone.

🔗 Related links

🔍 What does this change?

Debranding (libs/@hashintel/petrinaut):

  • ai-assistant-contents.tsx — tab "Petrinaut AI" → "AI"; empty-state copy → "Ask AI to create a Petri net, explain or revise the current model."; composer aria-label → "Message AI assistant".
  • apply-auto-layout-widget.tsx — "Petrinaut AI suggests…" → "The assistant suggests…".
  • ai-assistant-panel.tsx — internal error strings ("Petrinaut AI cannot run…", "Unknown Petrinaut AI tool") neutralised, since tool errors can surface in the transcript on hover.
  • ai-assistant-contents.test.tsx — assertion updated to the new copy.
  • Changeset added (patch for @hashintel/petrinaut).

Breadcrumbs:

  • top-bar.tsx + petrinaut-slots.ts (@hashintel/petrinaut) — the topBarStart slot now renders after the built-in sidebar-toggle/menu buttons, immediately before the net title, so hosts can lead into the title with breadcrumbs; and a new slots.titleStyle hook applies a host-supplied inline style to the title input, letting the HASH embed tint the title as the final crumb without competing with the editor's Panda styles. No other host used the slot (the HASH back arrow was its only consumer), so nothing regresses; the standalone petrinaut-website passes no slots and keeps its current look and title color.
  • embed-content.tsx (hash-frontend, inside the iframe) — passes topBarStart = a flex row containing a "Processes" ghost button — prefixed with the same ChartNetworkRegularIcon the HASH sidebar uses, navigating via the existing requestNavigateBack bridge message — and a chevronRight icon. Colors: crumb text + icon + title #677789, chevron #95a5b8 (per Dei; neither the MUI theme nor the ds tokens have exact tokens — closest are palette.gray[70] #64778C / palette.gray[50] #91A5BA — so both are pinned as documented constants). The colors are applied as inline styles (styled span inside the ds Button, style on the icon, slots.titleStyle) because the editor's layer-polyfilled Panda bundle compiles its recipe colors to a specificity that beats host emotion classes (FE-1228). Petrinaut's own top-bar controls keep their existing colors.
  • process-editor.tsx (hash-frontend, host page) — back to (almost) its main state: the onRequestNavigateBack handler stays, only the loading-skeleton comments and the iframe's accessible title ("Petrinaut editor" → "Process editor") changed.

Rename affordance decision: HASH's flows pages render the last crumb as a bordered chip with a caret dropdown; here the last crumb is instead Petrinaut's existing edit-in-place title input — the least invasive option that keeps rename working in the embed. Happy to switch to the chip+caret pattern in a follow-up if preferred.

Intentionally left (not user-visible in the HASH embed):

  • "Petrinaut" in code identifiers, comments, console logs, API route paths, and the petrinaut-core schema-validation error.
  • The user guide under libs/@hashintel/petrinaut/docs still names the product Petrinaut — it's shared product documentation (also consulted by the assistant at runtime) and never says "Petrinaut AI", so it needed no edits for this change. No doc screenshots show the AI panel or the HASH back arrow, so none went stale.

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
    • the user docs were audited: they already refer to the assistant neutrally ("AI assistant") and don't reference the removed strings or the HASH back arrow

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

The changes in this PR:

  • do not affect the execution graph

⚠️ Known issues

  • Breadcrumb styling inside the iframe is composed via the slot mechanism from @hashintel/ds-components primitives plus inline styles; the Petrinaut Panda bundle itself is untouched (mindful of the FE-1228 specificity clash).

🐾 Next steps

  • Dei (UX) to sanity-check the integrated bar (spacing/tint), crumb naming and the "AI" tab label on the preview.
  • Optionally restyle the title crumb as HASH's bordered chip + caret dropdown in a follow-up.
  • If HASH's breadcrumb grays ever become theme tokens, swap the pinned #677789 / #95a5b8 constants for them.

🛡 What tests cover this?

  • @hashintel/petrinaut unit tests (vitest): 174 passed, including the updated ai-assistant-contents empty-state assertion.

❓ How to test this?

  1. In HASH, open Processes → any saved process (or a draft). Petrinaut's top bar reads: sidebar-toggle, menu, then ⚙ Processes › <editable title> in HASH's breadcrumb grays — no separate bar above the editor, no back arrow, the name shown once. Clicking "Processes" returns to the list; renaming still works in place.
  2. Open the AI panel — the tab reads "AI" and the empty state reads "Ask AI to create a Petri net, explain or revise the current model."
  3. On the standalone petrinaut demo site, the top bar is unchanged apart from the same neutral AI wording (title color untouched).

🖼️ Demo

No screenshots from this environment — the reviewers' screenshots in the Slack thread show the "before" states; the Vercel preview shows the "after".

Verification run (after the two-tone color round): @hashintel/petrinaut lint:tsc (tsgo) ✅, oxlint ✅, vitest (174 tests) ✅, library build ✅; repo yarn lint:format ✅; eslint on the changed hash-frontend file ✅. A full hash-frontend tsc --noEmit could not complete in this environment (pre-existing unbuilt wasm @blockprotocol/type-system limitation) — CI's Package typecheck is the source of truth and was green on the previous head.

…mbs in the process editor

- AI assistant panel: tab now reads "AI", empty-state copy is "Ask AI to
  create a Petri net, explain or revise the current model.", and the
  composer label / auto-layout widget / internal error strings refer to
  the assistant neutrally (all hosts, per Ciaran's direction).
- HASH process editor: the host page now renders the standard
  TopContextBar breadcrumbs (Processes > <process title>), the in-iframe
  back-arrow button and its requestNavigateBack wiring are removed, and
  the live title is mirrored from the iframe over the existing bridge.
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Jul 22, 2026 3:38pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Jul 22, 2026 3:38pm
petrinaut Skipped Skipped Comment Jul 22, 2026 3:38pm

@github-actions github-actions Bot added area/apps > hash* Affects HASH (a `hash-*` app) 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 area/apps labels Jul 22, 2026
@claude
claude Bot requested a review from kube July 22, 2026 12:30
…rom Dei)

Instead of a host TopContextBar stacked above the editor, the HASH embed
now renders "Processes >" inside Petrinaut's top bar via the topBarStart
slot, with the editor's existing editable title as the final crumb — one
bar, the model name shown once, rename-in-place preserved. The slot now
renders after the built-in sidebar-toggle/menu buttons (no other host
uses it), and the Processes crumb navigates via the restored
requestNavigateBack bridge message.
@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Mostly user-visible copy and embed chrome; the slot move could affect any host that relied on topBarStart leading the bar, but only HASH used it.

Overview
AI assistant copy in @hashintel/petrinaut is de-branded globally: the panel tab is "AI", empty-state and composer labels say "AI" / "Message AI assistant", the auto-layout prompt refers to "the assistant", and tool error strings no longer mention Petrinaut. A patch changeset documents the library release.

Top bar hosting moves slots.topBarStart to render after the sidebar toggle and menu (still before the editable title) and adds slots.titleStyle so embeds can tint the title input—used by HASH so the title reads as the final breadcrumb crumb.

The HASH process iframe (embed-content.tsx) drops the back-arrow slot in favor of Processes › breadcrumbs (chart-network icon, chevron, shared gray tokens) that call the existing navigate-back bridge; readonly and editable modes both pass titleStyle. The host page only updates the loading skeleton comments and the iframe title to "Process editor".

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

…m Dei)

- Wrap the crumb in its own inline-styled flex row so spacing between
  "Processes", the chevron and the title is explicit (immune to the
  FE-1228 Panda specificity clash).
- Color the crumb, chevron and (via the new slots.titleStyle hook) the
  editable title #95a5b8 — HASH's breadcrumb gray, pinned as a constant
  since neither the MUI theme nor the ds tokens have an exact match.
- Add the Processes sidebar icon (ChartNetworkRegularIcon) as the crumb's
  prefix.
- The titleStyle hook is inline-style based and only applied by the HASH
  embed; the standalone website passes no slots and keeps its colors.
…prop

CI's hash-frontend TSC caught that ButtonProps has no `style`. Color the
button via an unlayered emotion rule on the wrapping MUI Box instead,
which also reliably beats the editor's layer-polyfilled Panda recipe
color (FE-1228).
Per Dei: crumb text, its icon and the process title are #677789; the
chevron separator stays #95a5b8 (matching the app's entities
breadcrumbs — no exact tokens exist for either). The colors are applied
as inline styles (styled span inside the ds Button, style on the icon,
slots.titleStyle) because the editor's layer-polyfilled Panda bundle
compiles its recipe colors to a specificity that beats host emotion
classes — which is why the crumb previously rendered dark.
@vilkinsons
vilkinsons added this pull request to the merge queue Jul 22, 2026
Merged via the queue into main with commit 4dbbdf6 Jul 22, 2026
51 checks passed
@vilkinsons
vilkinsons deleted the claude/h-6720-hash-embed-debranding-breadcrumbs branch July 22, 2026 16:17
This was referenced Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash* Affects HASH (a `hash-*` app) area/apps 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