Skip to content

feat(overview): add a device map card to the overview - #318

Merged
Developer-Simon merged 17 commits into
prereleasefrom
feat/devicemap-card
Dec 4, 2026
Merged

Developer-Simon merged 17 commits into
prereleasefrom
feat/devicemap-card

Conversation

@Developer-Simon

Copy link
Copy Markdown
Owner

Squash-merge commit message

Adds `device_map` as a new overview card type. It shows the saved device map read-only with live values, energy flow, zoom and pan, and the layers chosen in the layout editor.

- Shared renderer: the plant renderer moved from `energy-plant.js` into `devicemap-live.js` (`DeviceMapLive.create`), used by both the energy page and the card
- Viewport: `devicemap-viewport.js` handles zoom (0.1 to 3), pan, swipe vs. scroll, the fit spring and the fit pill shown from 2 % deviation
- Card: `devicemap-card.js` with per-card options (layers, role edges, automation links, edge style, line width, tap mode: highlight, device modal or nothing). Title header styled like the other cards
- Settings: catalog entry, schema fields and normalisation in Go. New cards start with energy and roles on, wiring and data off
- Overview: card scripts load lazily, and the card stays out of the grid swap on SSE ticks, so Cytoscape and the zoom survive
- Layout editor: card offered with its options. Docs updated

Known limits:
- Wiring edges still show with the wiring layer off, caused by the invalid selector in `devicemap-graph.js` (separate ticket, out of scope)
- A newly added card only appears after a page reload, because lazy card scripts load at page load only. This affects every lazy card type and is tracked as idea P2.37

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

Highlight translations

Highlights (de):
- Die Device-Map als Karte auf der Übersicht, mit Live-Werten, Energiefluss und Zoom

Tour

{
  "*": {
    "steps": [
      {
        "panel": "overview-panel",
        "target": "device-map-card",
        "device": "any",
        "need": "edit_layout",
        "title": {"de": "Device-Map auf der Übersicht", "en": "Device map on the overview"},
        "text": {
          "de": "Die Anordnung aus der Device-Map gibt es jetzt als Karte mit Live-Werten und Energiefluss. Du fügst sie im Layout-Editor hinzu und wählst dort die Ebenen. Zoomen geht mit Strg und Mausrad oder mit zwei Fingern, „Einpassen“ holt die ganze Anlage zurück.",
          "en": "The device map layout is now available as a card with live values and energy flow. Add it in the layout editor and choose its layers there. Zoom with Ctrl and the mouse wheel or with two fingers, Fit brings the whole plant back."
        }
      }
    ]
  }
}

Summary

Adds device_map as a new overview card type. It shows the saved device map read-only with live values, energy flow, zoom and pan, and the layers chosen in the layout editor.

Checks

  • The title is a Conventional Commits subject.
  • scripts/dev/check_tracked_secrets.sh is clean.
  • AI assistance disclosed per AI-DISCLAIMER.md: Claude Sonnet 5.5
  • Suites run locally: go test, go vet, npm test
  • Linked issue: none

Developer-Simon and others added 15 commits December 4, 2026 22:45
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e core

The renderer of the energy plant moves to devicemap-live.js, which
exposes window.DeviceMapLive.create(config). energy-plant.js keeps only
the plant configuration (fixed energy and balance layers, role edges
switch, node tap) plus the role edge switch and the row focus listener.
The data flow layer is loaded and drawn by the core when its layer is on.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Role edges end at the balance node, so they show with the balance or
the data layer. The shared edgeVisible() rule stays unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Alpine component deviceMapCard reads its options from the data-map-*
attributes of the card section and builds the shared renderer core with
a per-instance config. Zoom, pan and fit come from the viewport
controller, attached after every render. Modal taps open only real
devices, the dimmed opacity is 25 percent.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… and tap modes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
destroy() left a pending registry refresh armed, so a map that was
already gone could fetch energy once more. The timer is now cleared and
the pending flag reset. Also covers the card hint timer, the two-card
test on one window, and a live-core test for the cleared refresh.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e grid swap

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds the device_map card to the layout editor palette and its nine
options (four layers, role edges, automation links, edge style, line
width, tap) to the options dialog, with defaults and load/save mapping.
Catalog keys for de and en are added for the card and the new options.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…on wake

attach() now cancels a running fit spring before rebinding, so the old
cytoscape instance gets no further viewport calls. The dashboard-panel-changed
wake also refreshes energy when the card is active, so returning to the
overview no longer shows stale values until the next registry update.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e other cards

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Developer-Simon
Developer-Simon merged commit 1557b48 into prerelease Dec 4, 2026
27 checks passed
@Developer-Simon
Developer-Simon deleted the feat/devicemap-card branch December 4, 2026 21:53
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