From 0b8cb4f33f1ac0fc541f5d9d5c348ea93342d83e Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Sat, 31 Oct 2026 19:28:02 -0700 Subject: [PATCH] refactor(ui): remove the map stack chip DOM builders The dock renders the chips from the map source controls' published view, so renderMapStackChips, syncMapStackChips and MAP_STACK_CHIP_CLASS have no callers. Their tests now pin the chip models; the dock test keeps the rendered chips' button type and native enablement. --- CHANGELOG.md | 4 +- docs/CODE-BOUNDARIES.md | 6 +- src/mapStackChips.js | 116 ++-------------- src/mapStackChips.test.mjs | 263 +++++++----------------------------- src/ui/commandDock.test.mjs | 5 + src/ui/mapSource.js | 3 - 6 files changed, 71 insertions(+), 326 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 954779142..5b555f592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,8 +65,8 @@ - `createMapSourceControls()` (`./ui/maps`) no longer renders the map source chips into a `container` or writes a `statusElement`: it presents the chip row and status badge and hands them to its `publish` option, and Core's - dock renders them and calls `select()`. `renderMapStackChips` and - `syncMapStackChips` are deprecated (samehkhamis). + dock renders them and calls `select()`. `renderMapStackChips`, + `syncMapStackChips` and `MAP_STACK_CHIP_CLASS` are removed (samehkhamis). - `LocationControls` (`./ui/location`) no longer builds the city and landmark pills or writes the mini status: it presents the tray, including diff --git a/docs/CODE-BOUNDARIES.md b/docs/CODE-BOUNDARIES.md index ed77a4ecf..f0bb9e979 100644 --- a/docs/CODE-BOUNDARIES.md +++ b/docs/CODE-BOUNDARIES.md @@ -399,9 +399,9 @@ remain in their callers. `ui/maps` owns source-chip presentation, selection feedback and its subscription lifetime. It receives the existing controller and explicit state/action callbacks; it imports no renderer or application. Source construction and availability policy -remain with the map controller. Rebuilding controls removes their previous chip -listeners, and destruction suppresses late completions without owning or destroying -the supplied controller. +remain with the map controller. The dock renders the chips; rebuilding controls +drops their previous subscription, and destruction suppresses late completions +without owning or destroying the supplied controller. ## Layer panel diff --git a/src/mapStackChips.js b/src/mapStackChips.js index 5798e9fcf..fed2880b3 100644 --- a/src/mapStackChips.js +++ b/src/mapStackChips.js @@ -1,19 +1,18 @@ // MAP STACK source chips — the always-visible replacement for the `