Skip to content

Conversation

@asadarafat
Copy link
Contributor

Summary

  • Centralizes grid drawing and snapping config in a single ManagerGridGuide.
  • Adds a “Grid line width” slider in the layout drawer to adjust the overlay in real time.
  • Persists the chosen line width in annotations under viewerSettings.gridLineWidth.
  • Removes legacy grid configuration code to reduce duplication and drift.

What’s Included

  • Refactor: Introduce ManagerGridGuide to own overlay rendering and cytoscape-grid-guide options;
    dedupe theme colors and align default spacing.
  • Feature: UI control to adjust grid line width (0.10–2.00, step 0.05; default 0.5 [as previous]); updates both
    overlay and plugin visuals immediately.
  • Chore: Remove obsolete gridGuide.ts to avoid conflicting sources of truth.
  • Feature: Persist grid line width via annotations
    • Adds TopologyAnnotations.viewerSettings.gridLineWidth.
    • New extension endpoints: topo-editor-load-viewer-settings, topo-editor-save-viewer-settings.
    • Preserve viewerSettings on other annotation saves to avoid accidental loss.

Motivation

  • Make grid behavior and visuals consistent, easier to maintain, and quick to tweak from the UI.
  • Ensure user preferences survive reloads and are stored alongside other viewer-related
    annotations.

Developer Notes

  • ManagerGridGuide clamps line width to 0.1–2.0 and requests redraw with each change.
  • Theme detection is centralized; plugin options re-applied when spacing/line width/theme changes.
  • The legacy grid utilities were removed; all grid responsibilities live in ManagerGridGuide now.

Testing Instructions

CleanShot.2025-10-26.at.22.13.52.mp4
  • Open TopoViewer in edit mode.
  • Layout drawer -> adjust “Grid line width”; verify overlay thickness updates live.
  • Reload the webview; verify the line width restores from annotations.
  • Toggle VS Code theme; confirm grid color adapts and line width persists.
  • Validate grid snapping still works as before (drag and release nodes onto the grid).

Compatibility / Migration

  • Annotations files without viewerSettings will default to 0.5 line width; saving will add
    viewerSettings as needed.
  • Requires the extension-side endpoints shipped in this PR; older extension builds won’t persist
    the setting.

Housekeeping

  • No runtime behavior change to YAML persistence, only annotations.

…ML/annotations so no need reload to see the correct numbering
…ias group is detected, to make the behavior explicit.
…as labels; edge rewiring; cleanup

- Persist bridge alias label with per-interface identity (id = yamlNodeId:yamlInterface)
- Rebuild alias nodes from nodeAnnotations and rewire edges deterministically by interface
- Remove legacy aliasEndpointAnnotations on save; keep legacy read as fallback
- Save/merge annotations synthesized from edges to ensure all alias interfaces persist
- Refactor + lint fixes to reduce complexity
…t in annotations

  - Webview: on paste, set extraData.copyFrom to the source Cytoscape node id
  - Save: write nodeAnnotations.copyFrom, resolving to a stable annotation id for bridge
  aliases (yamlNodeId:yamlInterface) when possible
  - Types: document copyFrom as one-hop provenance only; never affects wiring/rewiring
  - Refactor paste code to extract provenance helper and reduce complexity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant