27 Commits

Author SHA1 Message Date
49d426eef3 Spur label: center at midpoint between w2 and w (right half)
Text centered at x = (w2 + w) / 2 — the middle of the wide right
portion of the trapezoid where there's the most space.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:36:10 +04:00
9197697129 Remove padding from spur label — wide end has plenty of room
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:35:07 +04:00
ff952c5cb1 Spur label: center at wide end (w/2), keep font at 14px
Place text centered at the wide bottom edge where there's always
enough room. No font shrinking — the wide end has plenty of space.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:34:10 +04:00
3adbfffb9d Spur label: position at 75% height in the wide bottom portion
Center text at 75% of trapezoid height where the shape is widest,
using the actual width at that height for proper fit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:32:23 +04:00
762e65e9a6 Spur label: center at the wide end of the trapezoid
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:31:35 +04:00
35aa0bf7dc Position spur label in the wider area of the trapezoid
Center text at vertical midpoint, shifted right toward the wider end
where there's more horizontal space. Uses 55% of the mid-height width
as center position and 85% as available width.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:31:11 +04:00
6b94339af2 Fix spur label: position at wider end, correct mirrored angle calculation
- Move text to 65% from top (wider end) so it fits without shrinking
- Fix effective angle for mirrored symbols: use (360-rot) to determine
  if flip is needed, preventing incorrect upside-down detection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:28:04 +04:00
072c80e886 Fix spur label sizing: use narrow end width so text fits inside trapezoid
Position text at 40% from top (toward narrow end) and constrain width
to the narrower edge so text never overflows the trapezoid shape.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:26:16 +04:00
3506d6164d Fix spur/mirrored symbol text: counter-mirror so text stays readable
Mirrored symbols need text counter-mirrored (scale -1,1) to prevent
backwards text. Restored mirror fix that was incorrectly removed.
Applied to both canvas renderer and SVG export.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:24:49 +04:00
c69d4080fa Mirror labels with their symbols instead of counter-mirroring
Labels now follow the mirrored shape naturally — text mirrors
along with the conveyor/shape as the user expects.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:11:01 +04:00
533465be3c Fix text readability: always right-side up on all conveyance types
Canvas renderer:
- Straight/spur: flip text 180 when rotation is 91-269 deg
- Mirror: counter-scale text so it doesn't read backwards
- Curved: compute world angle (sym rotation + tangent), flip if upside-down

SVG export:
- Curved text now includes rotation transform along the arc tangent
- Straight text includes rotation correction for readability
- All text stays grouped with its shape for proper transform inheritance

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:09:40 +04:00
ea367df42a Fix SVG export: group shape+text, preserve rotation, stroke-width 1px
- Wrap each conveyance shape + its label text in a <g> element so
  rotation/mirror transforms apply to both shape and text together
- Change stroke-width from 0.5 to 1 on all conveyance and PE shapes
  (both canvas renderer and SVG export)
- Text is now inside the group, inheriting the transform — no more
  floating unrotated labels

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:06:49 +04:00
896198c9d4 Fix label placement for curved and spur symbols
- Curved: position text at arc band midpoint, rotated along the curve
- Spur: center text in the trapezoid shape, not the bounding box

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 18:28:16 +04:00
07cee1c151 Add internal labels for conveyance symbols (canvas + SVG export)
Parse labels like UL17_22_VFD into stacked text: "UL" / "17-22".
Bold black Arial, targets 14px but auto-scales down to fit with
consistent padding. Strips _VFD suffix, splits prefix from numbers.
If full text doesn't fit, strips the letter prefix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 18:23:19 +04:00
09cafa4577 Fix shift-drag vertical movement, PE shape outline and hit-testing
- Fix shift-drag: require 8px movement before locking axis, use strict
  greater-than to avoid horizontal bias at small deltas
- Add PE shape-following outline for selection/hover/collision highlights
- Add PE shape-aware hit-testing (arrow + beam + receiver zones with margin)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 18:06:22 +04:00
c01173aa7b Draw conveyors/chutes/tippers/extendos programmatically for consistent stroke
SVG-based rendering caused non-uniform stroke scaling when symbols were
stretched. Now conveyor, chute, tipper are drawn as canvas rects, and
extendo is drawn as a canvas path with fixed left bracket proportions.
All use consistent 0.5px stroke regardless of size.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 17:22:14 +04:00
775c6e2e99 Make conveyors/chutes/inductions/extendos/spurs white; fix PE stroke and size
- Change all conveyance SVGs from black fill to white fill with black stroke
- Update programmatic rendering (curves, induction, spur) to white fill
- Replace PE 3-slice rendering with programmatic canvas paths for
  consistent stroke width at any size
- Reduce PE default size from 56x20 to 30x14 to fit around conveyor devices
- Update SVG export to match new white fills

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 17:17:09 +04:00
a4884b4e9b Fix EPC SVG export: match stroke width and right box position; rotate end 90°
- Right box stroke now uses EPC_CONFIG.lineWidth (1.5) instead of 0.3
- Right box positioned at -rb.w (backward) matching canvas renderer
- End box rotated 90° (perpendicular to line) in canvas, export, and hit-testing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:38:07 +04:00
c9a8dd8f5b Fix EPC rendering: thicker line, consistent strokes, correct end rotation
- Increase EPC line width from 0.4 to 1.5 for visibility
- Increase right box stroke from 0.3 to 1.0 to match left icon stroke
- Fix right box to extend behind last waypoint (like left icon), not forward

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 15:11:09 +04:00
d09ffd4a22 Fix spur/induction collision polygons to account for mirrored state
Collision detection now mirrors spur trapezoid and induction arrow
vertices when the symbol is mirrored, matching the visual appearance.
Previously the collision polygon stayed unmirrored causing false
positives/misaligned collision zones.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 19:05:53 +04:00
18c0e03287 Add marquee selection: click and drag on empty space to select multiple symbols
- Blue dashed rectangle drawn while dragging
- Selects all visible symbols whose bounding box intersects the marquee
- Respects hidden symbols and hidden groups

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:42:21 +04:00
3c532b8cfe Reduce label font size from 10px to 3px
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:41:18 +04:00
51794cb9ae Add device visibility controls: right-click hide and top bar type toggles
- Right-click context menu: "Hide" option to hide individual symbols
- "Show All Hidden" appears in context menu when anything is hidden
- Top visibility bar with toggle chips for each device group
- Hidden symbols are excluded from rendering, hit testing, and SVG export

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:36:01 +04:00
93afd0a554 Add device dock search, IDs drag-to-assign tab, and label drop-target highlight
- Add search filter to Devices tab in right dock
- Add IDs tab: flat list of unassigned device IDs, drag onto placed symbol to assign label
- Highlight drop target symbol with cyan glow during label drag
- Add labelDropTarget state and dropTarget theme entry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 17:40:08 +04:00
6f0ac836fb Refactor collision/distance modules, fix curved geometry, add mirror support
- Split collision.ts (707→549): extract distance.ts (pure math) and grid-snap.ts
- Fix curved conveyor/chute outline to match SVG viewBox geometry
- Draw curves programmatically with fixed 30px band width (no SVG stretching)
- Single resize handle for curves (was 2)
- Add .gitattributes for consistent line endings
- Make Vec2 type module-private
- Add mirror transform support in renderer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 17:21:04 +04:00
c5bb986a82 Refactor: extract render theme, hit-testing module, clean up legacy exports
- Extract 25+ hardcoded colors/sizes to render-theme.ts
- Extract pure hit-testing functions to hit-testing.ts (-104 lines from interactions.ts)
- Remove 11 legacy re-exports from symbols.ts, use config objects directly
- Fix preloadSymbolImages async/await anti-pattern
- Extract ensureEpcWaypoints() helper (3x dedup)
- Fix PDF not clearing on MCM switch
- Fix MCM persistence on reload
- Change defaults: grid off, grid size 2, min spacing 2

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 19:03:38 +04:00
eda97fc5bc real commit 2026-03-20 17:46:47 +04:00