Skip to content

refactor(ui): tokenize z-scale, geometry & grapheme truncation - #912

Merged
d-oit merged 2 commits into
mainfrom
refactor/tokenize-z-index-layout-geometry-16465881289276100300
Oct 6, 2026
Merged

d-oit merged 2 commits into
mainfrom
refactor/tokenize-z-index-layout-geometry-16465881289276100300

Conversation

@d-oit

@d-oit d-oit commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Refactored z-scale utilities, layout geometry constants, graph circular layout math, and grapheme label truncation across the studio codebase.

Fixes #869


PR created automatically by Jules for task 16465881289276100300 started by @d-oit


📝 Summary by GitNexus

Summary

A broad front end refactor centered on studio UI, graph layout, and text handling. Its graph reach is critical, despite the changed files being rated LOW risk.

🔴 CRITICAL blast radius. This appears to be a studio UI refactor touching layout and text utilities, with 15 direct and transitive dependents.

The change spans src/components/studio/command-palette.tsx, src/components/studio/views/graph-view.tsx, src/lib/studio/graph-layout.ts, and src/lib/text.ts, along with related studio components and tests. The affected modules are Views, Studio, and Ui, and 71 execution flows pass through changed symbols.

Review the command palette and graph layout changes first, then check the text handling alongside src/lib/text.test.ts. No files are individually rated HIGH or CRITICAL risk, and there are no cross repository consumers.

Added by GitNexus for PR #912. Edit freely — this block is replaced on the next review, everything above it is left untouched.

- Tokenize z-scale in globals.css @theme block (--z-index-1, --z-index-toast, --z-index-shortcuts, --z-index-overlay, --z-index-skiplink) and replace arbitrary z-[NNN] utilities
- Extract COMMAND_PALETTE_WIDTH_CLASS, COMMAND_PALETTE_TOP_MARGIN_CLASS, and SIDEBAR_WIDTH_CLASS geometry constants
- Derive circular graph layout dynamically from canvas dimensions via computeCircularLayout in graph-layout.ts
- Implement grapheme-safe truncateGraphemes with Intl.Segmenter in src/lib/text.ts and export GRAPH_LABEL_MAX (24) and TRIZ_LABEL_MAX (12) constants
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
do-knowledge-studio Ready Ready Preview, v0 Oct 6, 2026 6:08am UTC

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Blocked merge diagnosis — blocked
⏳ Check run(s) still in progress: ["Quality Gate","Dependency Verify","Unit Tests","Codacy Static Code Analysis","Secret Detection","Trivy Filesystem Security Scan","Infrastructure as Code Security","Dependency Advisory Audit","Diagnose Blocked Merge State","Shell Script Security Analysis","commitlint","labeler","Analyze (actions)","Analyze (javascript-typescript)","GitNexus"]

@nexus-check

nexus-check Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
Akon Labs

GitNexus Review · PR #912

2 issues found across 1 file.

Summary

A broad front end refactor centered on studio UI, graph layout, and text handling. Its graph reach is critical, despite the changed files being rated LOW risk.

🔴 CRITICAL blast radius. This appears to be a studio UI refactor touching layout and text utilities, with 15 direct and transitive dependents.

The change spans src/components/studio/command-palette.tsx, src/components/studio/views/graph-view.tsx, src/lib/studio/graph-layout.ts, and src/lib/text.ts, along with related studio components and tests. The affected modules are Views, Studio, and Ui, and 71 execution flows pass through changed symbols.

Review the command palette and graph layout changes first, then check the text handling alongside src/lib/text.test.ts. No files are individually rated HIGH or CRITICAL risk, and there are no cross repository consumers.

🔀 Structural changes · refactor/tokenize-z-index-layout-geometry-16465881289276100300 → main

Both branches are separately indexed, so this compares their code graphs directly — what the diff cannot show.

Symbols added (3)

  • src/lib/studio/graph-layout.ts::computeCircularLayout
  • src/lib/text.ts::getGraphemeSegmenter
  • src/lib/text.ts::truncateGraphemes

Full detail lives in the GitNexus check run for this commit.

@nexus-check

nexus-check Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Agent context for GitNexus Review · PR #912

This comment carries deterministic graph detail for coding agents and reviewers who want the receipts — the main review comment carries the human summary.

🔴 CRITICAL blast radius — this change reaches 15 downstream symbols across 3 modules; this lands on a critical surface, so review the dependents carefully before merging. (driven by dependent/module count, not file risk)

Blast Level Dependents Modules Files
🔴 CRITICAL 15 3 14

What changed

Symbol Changes (24)
Kind Symbol Location
Function AppShell src/components/studio/app-shell.tsx:219
Interface CmdItem src/components/studio/command-palette.tsx:23
Property id src/components/studio/command-palette.tsx:24
Property label src/components/studio/command-palette.tsx:25
Property hint src/components/studio/command-palette.tsx:26
Property icon src/components/studio/command-palette.tsx:27
Property onSelect src/components/studio/command-palette.tsx:28
Property group src/components/studio/command-palette.tsx:29
Function CommandPalette src/components/studio/command-palette.tsx:37
Function ShortcutsDialog src/components/studio/shortcuts-dialog.tsx:109
Function Sidebar src/components/studio/sidebar.tsx:179
Function setCommandOpen src/components/studio/sidebar.tsx:181
Function Overlay src/components/studio/ui/overlay.tsx:164
Function GraphView src/components/studio/views/graph-view.tsx:27
Function entities src/components/studio/views/graph-view.tsx:28
Function selectedEntityId src/components/studio/views/graph-view.tsx:29
Function positioned src/components/studio/views/graph-view.tsx:68
Interface MatrixCellProps src/components/studio/views/triz-matrix-view.tsx:14
TypeAlias FilteredParameter src/components/studio/views/triz-matrix-view.tsx:12
Property rowIndex src/components/studio/views/triz-matrix-view.tsx:15
Function MatrixRow src/components/studio/views/triz-matrix-view.tsx:71
Function NavigationMenuIndicator src/components/ui/navigation-menu.tsx:148
Function ToastViewport src/components/ui/toast.tsx:14
Function placeGraphNodes src/lib/studio/graph-layout.ts:206
Changed Files (14)
File Status
src/app/globals.css 🟡 modified
src/components/studio/app-shell.tsx 🟡 modified
src/components/studio/command-palette.tsx 🟡 modified
src/components/studio/shortcuts-dialog.tsx 🟡 modified
src/components/studio/sidebar.tsx 🟡 modified
src/components/studio/ui/overlay.tsx 🟡 modified
src/components/studio/views/graph-view.tsx 🟡 modified
src/components/studio/views/triz-matrix-view.tsx 🟡 modified
src/components/ui/navigation-menu.tsx 🟡 modified
src/components/ui/toast.tsx 🟡 modified
src/lib/studio/graph-layout.test.ts 🟡 modified
src/lib/studio/graph-layout.ts 🟡 modified
src/lib/text.test.ts 🟢 added
src/lib/text.ts 🟢 added

What it affects

Architecture Impact

Module Hits Direct
Views 12 🟢
Studio 8 🟢
Ui 6 🟢

Blast Radius

Depth Count
d1 (direct) 9
d2 (indirect) 4
d3 (transitive) 2
Direct dependents (d1)
  • src/components/studio/views/triz-matrix-view.tsx:119 · MatrixTable
  • src/components/studio/views/encrypt-export-dialog.tsx:23 · EncryptExportDialog
  • src/components/studio/right-panel.tsx:315 · InspectorPanel
  • src/components/studio/views/reset-confirm-dialog.tsx:17 · ResetConfirmDialog
  • src/app/page.tsx:5 · Home
  • src/components/studio/mobile-drawer.tsx:356 · MobileDrawer
  • src/components/studio/views/editor-claims-panel.tsx:120 · ClaimsPanel
  • src/components/studio/views/import-preview-dialog.tsx:17 · ImportPreviewDialog
  • src/components/ui/toaster.tsx:13 · Toaster
Indirect dependents (d2)
  • src/components/studio/views/export-view.tsx:16 · ExportView
  • src/components/studio/views/editor-view.tsx:145 · EditorView
  • src/components/studio/views/triz-matrix-view.tsx:172 · TrizMatrixView
  • src/components/studio/right-panel.tsx:458 · RightPanel
Transitive dependents (d3)
  • src/components/studio/app-shell.tsx:125 · ViewRouter
  • src/components/studio/views/triz-view.tsx:15 · TrizView

What to check

File Risk (1)
File Risk Category
src/app/globals.css 🟢 LOW Assets
Prompt for AI agents (2 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.

<file name="src/lib/text.ts">

<violation number="1" location="src/lib/text.ts:39">
P2: Legacy fallback splits multi-code-point graphemes — When 'Intl.Segmenter' is unavailable or its construction fails, 'Array.from(text)' splits into Unicode code points, not user-perceived grapheme clusters. Thus a family emoji or a base letter plus combining mark is counted/truncated as multiple units, despite this utility's documented grapheme behavior. The package declares no browser target that rules out this fallback; the implementation explicitly keeps it for legacy environments.
</violation>

<violation number="2" location="src/lib/text.ts:34">
P2: Truncation can exceed the requested grapheme limit — The documented contract says the result is at most 'maxGraphemes', but the forced minimum of one retained grapheme plus the ellipsis makes that impossible when the limit is 1 (or smaller). For example, a two-grapheme input with the default ellipsis and 'maxGraphemes = 1' returns one source grapheme plus '…', i.e. two graphemes. The fallback repeats the same calculation.
</violation>

</file>

@codacy-production

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 11 complexity · 0 duplication

Metric Results
Complexity 11
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Comment thread src/lib/text.ts
Comment thread src/lib/text.ts
@d-oit
d-oit enabled auto-merge (squash) October 6, 2026 06:06
@d-oit
d-oit merged commit af799df into main Oct 6, 2026
22 of 23 checks passed
@d-oit
d-oit deleted the refactor/tokenize-z-index-layout-geometry-16465881289276100300 branch October 6, 2026 06:07

This branch was successfully deployed

1 active deployment
Preview — cd9ffa18 Deployed Oct 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config tests Related to automated/manual tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tokens] Z-layers by vibes and graph magic numbers — tokenize z-scale, derive layout from canvasSize

1 participant