Wrap long feeder names at substation extremities (Issue 1)#3
Merged
marota merged 6 commits intoJul 3, 2026
Conversation
…names Three UX fixes for the network diagram and SLD: - Feeder names at a substation's extremities no longer overlap. Beyond the branch relabelling (Issue 1), a new applyFeederLabelWrap pass wraps EVERY long feeder name (generators, loads, and branches whose far-end VL is unnamed) inside each feeder cell, and wrapFeederLabel now breaks long single-token ids on their _/-/. separators. - VL disks are interactive across their whole area, even where a branch is drawn on top: when the direct hit-test lands on an occluding edge, the handlers fall back to document.elementsFromPoint and pick the first VL disk/name box in the paint stack (discrete events only, no per-frame cost). - The VL name box on the NAD is interactive too — a single click opens its SLD. Resolved through metadata.textNodes (new textNodesBySvgId map on the metadata index) that maps each label box to its VL. Docs + unit tests updated (feederLabels, metadataIndex, vlInteractions). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aLzZJp3MP3qYBr1WKGRC6
PR #3 targets the `claude/sld-voltage-navigation-mypy-1zm3om` working branch, but the Code Quality / Tests / Parity workflows only fired on `pull_request` events whose base was `main`, so no CI ran for it. Broaden each `pull_request` trigger to `branches: ['**']` so CI runs on PRs targeting any branch. `push` stays restricted to main, and the HuggingFace deploy workflow is left untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aLzZJp3MP3qYBr1WKGRC6
Empty commit to fire a pull_request synchronize event now that repo-level GitHub Actions is enabled, so Code Quality / Tests / Parity run on PR #3. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aLzZJp3MP3qYBr1WKGRC6
A pull_request whose base is not `main` is matched against the base branch's own trigger (still main-only), so broadening the head branch's pull_request filter alone did not fire CI for PR #3. Add the `claude/**` working branches to the push trigger so pushes to this branch get commit-level checks that surface on the PR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aLzZJp3MP3qYBr1WKGRC6
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aLzZJp3MP3qYBr1WKGRC6
The pull_request `branches: ['**']` change (read from the PR head branch's workflow) is confirmed to trigger CI for PR #3, so the `claude/**` push trigger is no longer needed and only produced duplicate runs. Restore push to `main`-only; keep the broadened pull_request filter. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aLzZJp3MP3qYBr1WKGRC6
cda1bb8
into
claude/sld-voltage-navigation-mypy-1zm3om
4 checks passed
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
Extends the feeder-label wrapping system to handle all long equipment names at substation extremities — not just relabelled branches, but also generators, loads, and unmatched branches whose far-end VL is unnamed. This prevents the label pile-up that survived Issue 1's branch-only relabelling on dense VLs.
Key Changes
Enhanced
wrapFeederLabel()to break long single words on separatorsbreakLongWord()helper that splits identifiers likevirtual_relation_8423568_a_0-225on_,-,.boundaries within a character budgetNew
applyFeederLabelWrap()function.sld-extern-cell,.sld-intern-cell,.sld-shunt-cell)data-feeder-wrap/data-feeder-wrap-origattributesVL name-box interactivity
vlInteractions.tsto resolve clicks on VL name boxes (.nad-label-box) in addition to disk clicksdocument.elementsFromPointwhen a branch is drawn on top of a disk, so the disk remains interactive across its whole areatextNodesBySvgIdIntegration in
useSldFeederRelabelhookapplyFeederLabelWrap()right afterapplyFeederRelabels()Implementation Details
breakLongWord()scans backward from the character budget to find a separator, ensuring pieces rejoin exactly into the original wordwrapFeederLabel()now handles both space-separated words and long single words, applying the two-level splitting strategyelementsFromPointfallback invlInteractions.tsonly runs on discrete pointer events (mousedown/hover), never per frame, preserving the performance contractequipmentIdwhenvlNodelink is absent, maintaining compatibility with older metadata formatsdata-feeder-wrap-origstores the original text for restoration on subsequent callsTests
wrapFeederLabeltests to verify long single-word breaking behaviorapplyFeederLabelWraptest suite covering long names, short names, numeric labels, relabelled feeders, highlight clones, and restorationvlInteractionstests for paint-stack resolution and name-box click handlingmetadataIndextests for text-node mapping with vlNode links and fallbackshttps://claude.ai/code/session_014aLzZJp3MP3qYBr1WKGRC6