You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8901820
Browse filesBrowse the repository at this point in the historyBrowse files
-**Hero video** — replaced the NFC SVG icon with the product helper video (`assets/video/tiger_pod/helper_tiger_pod_movies.mp4`); plays on modal open, pauses on close. Rings animation kept behind the video.
13
+
-**Layout** — title "Tiger POD Free STL" moved above the video; hero `padding-top: 16px` for breathing room; hero height 240 px (was 200 px); video height 156 px (+30 %).
14
+
-**Copy overhaul** (all 9 locales):
15
+
- Modal title: "Build your TigerPOD" → "Print your TigerPOD Now !"
16
+
- Description: "program" → "Burn TigerTag RFID chips"
-**Feature cards** — icons replaced by numbered orange gradient badges ①②③④; updated copy: Dual RFID Reader / Dual Link / Print in Place / 1kg Standard spool with matching sub-labels.
22
+
-**AutoScan without reader** — `+ Scan` button now opens the TigerPOD modal when no reader is connected (previously opened the Pod Scan panel).
23
+
24
+
### Pod Scan side-panel — removed
25
+
26
+
-`<aside id="scanPanel">`, overlay, and all associated DOM were removed — the panel had no remaining triggers.
27
+
- JS: `_openScanPanel`, `_closeScanPanel`, `_updateScanPanel` and their listeners deleted.
28
+
- CSS: full `.scan-dp` / `.sdnr-*` block removed from `70-detail-misc.css`.
-**No more data wipe on reconnect** — `bambuConnect` preserves `conn.data` when reconnecting to the same IP; the UI no longer flashes to zero while the MQTT handshake completes.
35
+
-**No more false "idle" overwrite** — `_normState` returns `null` (not `"idle"`) when the message contains no state field; `_bblMerge` only updates `d.printState` when a real state is present (`!= null`).
36
+
-**AMS / external tray merge already correct** — merge-by-ID loop introduced in v1.8.0 preserved; old-firmware temp fallback gated on `!dev`.
37
+
38
+
### Printer grid/table — click reliability
39
+
40
+
-**Bambu status changes no longer cause full grid rebuild** — `_bblNotify` only passes `statusChanged=true` (→ `renderPrintersView()`) when the printer actually crosses the online/offline section boundary; intermediate connecting-state transitions just update the badge in-place via `_bambuRefreshOnlineUI`. Eliminates the DOM-rebuild race that swallowed clicks during connection.
41
+
-**Document-level mouseup fallback** — if a DOM rebuild happens between `mousedown` and the `click` event (causing the click to land on a detached element that doesn't bubble), `_pendingPrinterOpen` is consumed by a `document mouseup` + `setTimeout(0)` safety net. Works for both grid and table views.
42
+
43
+
### Color edit modal (TD1S) — swatch pencil icon
44
+
45
+
- Edit pencil always visible at 65 % opacity, 95 % on hover.
46
+
-**Light-color detection** (`_ceIsLight`) — perceptual luminance formula `(0.299R + 0.587G + 0.114B)/255 > 0.55`; black icon + dark hover ring applied via `ce-swatch--light` class when the swatch background is light.
47
+
-`_ceUpdateSwatch(swatchEl, hex)` centralises background + icon color + class updates.
48
+
49
+
### Add Product modal — TD1S integration
50
+
51
+
- TD1S button in ADP now opens "Set Color & TD Value" modal (was the tester modal).
52
+
- Save writes back to `_adpColorSlots` + `adpTd` input (not Firestore) via the `onSave` callback on `openColorEditModal`.
53
+
54
+
### Product ID help modal
55
+
56
+
- ✕ close button removed (backdrop click remains the close affordance).
57
+
- "Explore the TigerTag+ material list" button closes the modal after opening the external link.
58
+
- Label updated: "Browse the TigerTag material list" → "Explore the TigerTag+ material list" (all 9 locales).
59
+
60
+
### Mini dashboard — badge labels
61
+
62
+
- Stat chip labels now render actual badge HTML (`<span class="tag-diy">`, `<span class="tag-plus">`, `<span class="tag-cloud">`) instead of plain text.
63
+
- TigerTag Cloud chip styled identically to the other chips (removed purple override).
64
+
65
+
### RFID reader badges — filled pill redesign
66
+
67
+
-**Disconnected** — filled red gradient `#be2d2d→#d83b3b`, white text, `opacity: .85`.
68
+
-**Connected** — subtle green tint background, `color: var(--success)`.
69
+
-**Card present** — filled green gradient `#0d8a52→#1aaf6c`, white text.
70
+
71
+
### Tiger Scales — header badge
72
+
73
+
-`⚖` emoji replaced by a "Tiger Scales" text pill badge in the header status bar.
74
+
- Three CSS states: gray/transparent (no scale), green tinted (connected), red tinted (no scale paired).
75
+
76
+
### TigerTag+ product preview
77
+
78
+
- After clicking "Check" with a product ID, the preview now shows the full label: **Brand · Series · Name · Weight · Refill** (e.g. "R3D PLA High Speed Orange 1kg Refill").
79
+
- Brand name sourced from `api.brand` (catalogue field) — more reliable than the local numeric `id_brand` lookup at check time.
80
+
- "Refill" token only shown when `api.filament.refill === true`.
81
+
- Thumbnail enlarged (44 × 44 px, border added).
82
+
83
+
### Detached Camera Wall
84
+
85
+
- New standalone window (`renderer/cam/`) showing all online printer cameras simultaneously — open via the "Detach" toolbar button in the cam view.
86
+
- Supports all camera types: Bambu Lab (MJPEG over IPC), Creality (WebRTC), Snapmaker / FlashForge (iframe).
87
+
- MJPEG and Bambu frames forwarded to the detached window via `BroadcastChannel('cam-frames')` with zero-copy `ArrayBuffer` transfer.
88
+
- Creality WebRTC uses a single `RTCPeerConnection` shared across the cam wall card, the printer sidecard, and the detached window — prevents duplicate connections (firmware only accepts one peer at a time).
89
+
90
+
### Image loading — skeleton animation
91
+
92
+
- All web-sourced images now display a shimmer skeleton while loading (TigerTag+ preview, add-from-web, product check, etc.).
93
+
- Auto-applied via `MutationObserver` — no per-site instrumentation needed.
Copy file name to clipboardExpand all lines: CLAUDE.md
+88Lines changed: 88 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,94 @@ Every file read and grep costs tokens. Follow these rules on every task to keep
32
32
-**Complex task** (multi-file refactor, new system, multi-layer debugging, architecture) → if reasoning feels shallow or you keep making mistakes, ask to switch to **claude-opus**. Phrasing: *"This task is complex — switching to Opus will give a better result."*
33
33
- Do not wait for the user to notice a problem: signal the mismatch as soon as it is obvious.
34
34
35
+
---
36
+
37
+
## 📋 WORKLOG.md — running change log
38
+
39
+
`WORKLOG.md` at the repo root is the **single source of truth** for everything done since the last commit. It replaces memory and makes commit prep instant.
40
+
41
+
### Rule 1 — Update immediately after every change
42
+
43
+
Do not batch updates. The moment you finish editing a file, append the entry to `WORKLOG.md`. If you delete something — write it in `Removed`. If you fix a bug in something you just added — merge into the existing entry. The log must reflect reality at all times.
44
+
45
+
### File format
46
+
47
+
```markdown
48
+
# Worklog — vX.Y.Z (in progress)
49
+
50
+
## Added
51
+
- Short description — `file.js`, `file.css`
52
+
53
+
## Changed
54
+
- Short description — `file.js` (what and why)
55
+
56
+
## Fixed
57
+
- Bug description — `printers/bambulab/index.js`
58
+
59
+
## Removed
60
+
- What was deleted and why — `file.js`, `file.css`, i18n keys
61
+
62
+
## i18n
63
+
- Added: `key1`, `key2` — 9 locales
64
+
- Removed: `oldKey1`, `oldKey2` — 9 locales
65
+
```
66
+
67
+
Rules:
68
+
- One bullet = one logical change. Group sub-bullets under it if needed.
69
+
- Always name the file(s) touched.
70
+
- For removals: state **what** was removed, **why**, and **which files** it touched (JS + CSS + HTML + locales).
71
+
- i18n section: always list keys by name, never just a count.
72
+
73
+
### Rule 2 — Keep it clean as you go
74
+
75
+
WORKLOG.md is a working draft, not a commit log. Apply these edits in real time:
76
+
77
+
-**Intermediate steps vanish.** If you added a feature and then changed it three times, the final entry describes the end state only — not the journey.
78
+
-**Bugs in the same session collapse.** "Added X" + "Fixed X" → one "Added X (with fix for Y)" entry, not two.
79
+
-**Reverts disappear entirely.** If you added something and then removed it in the same session, delete both entries — it never shipped, it has no place in the log.
80
+
-**No implementation noise.** WORKLOG describes *what changed for the user / codebase*, not how Claude did it ("updated selector on line 42", "added guard in bambuConnect"). One sentence per logical change.
81
+
82
+
### Rule 3 — Synthesize at commit time
83
+
84
+
Before writing the `CHANGELOG.md` entry, do one final editorial pass on WORKLOG:
85
+
86
+
1.**Merge related items.** Several "TigerPOD modal" entries → one grouped bullet with sub-items.
87
+
2.**Drop ephemeral noise.** Version bump, llms.txt update, internal refactors with no user-visible effect → omit or fold into a single "internal" line.
88
+
3.**User-facing language.** CHANGELOG is read by end users. Rewrite technical entries in plain language ("Bambu MQTT: fix _normState null return" → "Bambu Lab: printer state no longer resets to idle when receiving a status update mid-print").
89
+
4.**Verify i18n delta.** Run `npm run i18n:check` — confirm key count matches WORKLOG before writing the CHANGELOG line.
90
+
91
+
### At commit time (3 steps, in order)
92
+
93
+
1.**Synthesize `WORKLOG.md`** (Rule 3 above) → write the new `CHANGELOG.md` entry
94
+
2.**Include `WORKLOG.md` in the commit** — it is part of the repo history (future sessions can read it via `git show`)
95
+
3.**Reset `WORKLOG.md`** immediately after committing — replace with the blank template for the next version (bump the version number in the header):
96
+
97
+
```markdown
98
+
# Worklog — vX.Y.Z (in progress)
99
+
100
+
## Added
101
+
102
+
## Changed
103
+
104
+
## Fixed
105
+
106
+
## Removed
107
+
108
+
## i18n
109
+
```
110
+
111
+
**The old data is not lost** — it exists in two permanent places:
112
+
-`git show HEAD:WORKLOG.md` — the raw working log, forever in git history
113
+
-`CHANGELOG.md` — the synthesized release entry, human-readable
114
+
115
+
The working file is wiped so it stays clean and unambiguous: whatever is in `WORKLOG.md` right now is *only* what has been done since the last commit, nothing older.
116
+
117
+
### Before starting any task
118
+
119
+
`Read WORKLOG.md` at the start of a new session — it tells you exactly what has been done since the last commit, without relying on the conversation summary.
120
+
121
+
---
122
+
35
123
## Stack
36
124
Electron (no bundler) + vanilla HTML/CSS/JS. Entry: `main.js`. Renderer: `renderer/inventory.html` + modular CSS in `renderer/css/` + `renderer/inventory.js`. Preload bridge: `preload.js`.
-**Detached Camera Wall window** — standalone `BrowserWindow` showing all online printer cameras simultaneously; opened via "Detach" toolbar button in cam view; receives camera descriptors via IPC `cam:open-detached`; supports all camera types (Bambu MJPEG/IPC, Creality WebRTC, Snapmaker/FlashForge iframe) — `renderer/cam/cam.html`, `renderer/cam/cam.js`, `renderer/cam/cam.css`, `renderer/cam/cam-preload.js`, `main.js`, `preload.js` (`openCamWindow`), `renderer/css/40-printers.css` (`.cam-wall-toolbar`, `.cam-wall-detach-btn`)
6
+
-**Camera frame broadcast to detached window** — `cam_manager.js` uses `BroadcastChannel('cam-frames')` to forward MJPEG/Bambu frames to the detached window with zero-copy transfer — `renderer/printers/cam_manager.js`
7
+
-**Creality multi-surface WebRTC** — single `RTCPeerConnection` shared across cam wall card, sidecard, and detached window via `addCreCamConsumer` / `removeCreCamConsumer` API; prevents duplicate connections (firmware only accepts one peer) — `renderer/printers/creality/widget_camera.js`, `renderer/printers/creality/index.js`
8
+
-**TigerTag+ IPC handlers** — `rfid:refresh-api` (re-fetch product data for an existing chip) and `rfid:lookup-product` (validate product_id without a chip) exposed via main process and preload bridge — `main.js`, `preload.js`
9
+
-**Color edit swatch improvements** — swatches now show a pencil edit icon; light color detection (`_ceIsLight`) inverts icon and hover ring to black for legible contrast on light swatches; `openColorEditModal(r, onSave)` accepts optional callback for ADP mode (no Firestore write) — `renderer/IoT/td1s/edit-modals.js`, `renderer/IoT/td1s/td1s.css`
10
+
-**TigerPOD numbered feature badges** — replaced SVG icon spans with orange gradient numbered circles (①②③④) on the 4 feature cards — `renderer/inventory.html`, `renderer/css/60-modals.css`
-**TigerTag+ product preview enrichment** — after ID check, preview now shows Brand + Series + Name + Weight + Refill label (was: name only); brand sourced from `api.brand` directly (more reliable than local `id_brand` lookup at check time) — `renderer/inventory.js` (`_lookupPlusProduct`)
13
+
-**Tiger Scales text badge** — replaced `⚖` emoji with a styled "Tiger Scales" pill badge (gray / green connected / red no-scale states) — `renderer/inventory.html`, `renderer/IoT/tigerscale/tigerscale.css`
14
+
-**AutoScan → TigerPOD modal fallback** — clicking "+ Scan" button without a connected RFID reader now opens the TigerPOD modal instead of the removed Pod Scan panel — `renderer/inventory.js`
15
+
-**Image skeleton / shimmer animation** — all web-sourced `<img>` elements get a shimmer skeleton while loading; fade-in on completion. Covers TigerTag+ preview, add-from-web, check product image. Auto-applied via `MutationObserver` + capture-phase `load` listener — `renderer/inventory.js`, `renderer/css/00-base.css`
16
+
-**Bambu Lab: data preservation across reconnects** — `_prevData` saved before `bambuDisconnect` and restored to new connection object, preventing zeroed-out printer state on reconnect — `renderer/printers/bambulab/index.js`
17
+
-**Bambu Lab: null return from `_normState`** — when no state field present in MQTT payload, returns `null` instead of `"idle"`, preventing false idle overwrites mid-print — `renderer/printers/bambulab/index.js`
18
+
-**Printer sidecard: document mouseup fallback** — `_pendingPrinterOpen` intent captured on `mousedown`; `document` mouseup + `setTimeout(0)` fires `openPrinterDetail` if DOM rebuild ate the click event — `renderer/inventory.js`
19
+
20
+
## Changed
21
+
22
+
-**TigerPOD modal title** — "Build your TigerPOD" → "Print your TigerPOD Now!" — i18n `tigerPodModalTitle`
23
+
-**TigerPOD modal description** — "program TigerTag RFID chips" → "Burn TigerTag RFID chips" — i18n `tigerPodModalDesc`
-**Bambu Lab: `onStatus` rebuild guard** — full `renderPrintersView()` call now only fires when printer crosses the online ↔ offline section boundary (not on every MQTT status event), eliminating the rapid DOM rebuild that was making the sidecard unclickable — `renderer/printers/bambulab/index.js`
35
+
-**Printer sidecard: always openable** — removed state guards that blocked `openPrinterDetail` when printer was in connecting/disconnected state — `renderer/inventory.js`
-**llms.txt updated** — i18n count 778 → 791 keys; TigerPOD triggers updated; RFID badge description updated; git tag example updated
38
+
39
+
## Fixed
40
+
41
+
-**Bambu Lab MQTT data wipe on `pushall`** — receiving `{"pushing":{"command":"pushall"}}` was resetting all printer data to zero. Root cause: two bugs — (1) reconnect created a fresh zeroed `conn.data`, (2) `_normState` returned `"idle"` for payloads with no state field. Both fixed — `renderer/printers/bambulab/index.js`
42
+
-**Printer sidecard unclickable** — grid/table sidecard cards couldn't be opened reliably during Bambu connecting phase. Fixed by reducing rebuild frequency + mouseup fallback — `renderer/inventory.js`, `renderer/printers/bambulab/index.js`
0 commit comments