D11 - merge origin/Micron-Assets: the Micron asset picker, adapted to R2
Integrates Cody Schaefer's 7ef1fcd (written against pre-R2 main) per Nick's
instruction of Aug 20. The catalog lookup arrives whole: read-only /api/assets
backed by server/assets_db.py (one SELECT, env-only MICRON_DB_URL, 503-not-500
when broken, driver errors logged not propagated), the searchable picker with
CSV import and Excel column paste, catalog rows badged and locked to the DB's
casing, manual rows visibly unvouched, and graceful absent/unreachable states.
Three conflicts, resolved as unions of both sides' intent; the adaptations and
their reasons are recorded in docs/waves/decisions-2026-08-20.md:
- renderPackage: Cody's two-column asset table inside T9.1's sectioned
add('assets', ...) frame, so the CR-006 toggle keeps governing the export.
- bootData: initAssetPicker() joins the R2 loads instead of replacing them.
- The asset card: his picker UI, plus role=status on the source note (C1).
- Six imported alert() calls converted to the creator's idioms: file errors
through toast(msg,'alert') as the drawings uploader does; the instructional
and summary messages through the T7.9 kit, which gains the one-button
wpAlertDialog shape (BL-024's console conversions will want it too).
New probe: assets_check (27) - read-only structurally, unconfigured/broken as
first-class states, no credential echo, search ranking, casing canonicalisation,
import fallback + dedup, kit-not-native summary. One sections_check pin
re-pointed with the reason in code: normaliseAsset now stamps legacy rows
source:'manual' on load, so the CR-016 check compares content, not bytes.
Battery after merge: assets_check 27/27, creator_dialogs_check 20/20,
sections_check ALL PASS, export_check 20/20, helptip_check 13/13,
mobile_check 24/24, icon_check 5/5, color_check 5/5, form_structure_check
50/51 (the one red is BL-022, unchanged, deliberate).
Item: D11 (new scope, new id per the working rules). Out-of-scope note in
completion.md amended - 'no integration code exists' was true when written.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
55
docs/waves/decisions-2026-08-20.md
Normal file
55
docs/waves/decisions-2026-08-20.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# Decisions — August 20, 2026
|
||||
|
||||
One item. Like the August 18 set, it is a **new item** with its own `D` id, not a
|
||||
reinterpretation of an existing one.
|
||||
|
||||
---
|
||||
|
||||
## D11 — The Micron asset picker merges into the R2 creator
|
||||
|
||||
- **Arrived as:** `origin/Micron-Assets` (`7ef1fcd`, Cody Schaefer, Aug 18) — written
|
||||
against pre-R2 `main`, integrated here by Nick's instruction on Aug 20.
|
||||
- **Amends:** the R2 completion record's "Asset database integration — out of scope,
|
||||
confirmed unbuilt" line, which was true when written and stops being true here.
|
||||
- **Surface:** `html/` (creator), `server/` (`assets_db.py`, `/api/assets`),
|
||||
`docker-compose.yml`, `requirements.txt`.
|
||||
|
||||
### What the branch brought
|
||||
|
||||
A read-only lookup onto the Micron asset catalog (a SQL Server instance outside this
|
||||
repo): the whole catalog is fetched once per creator page load through `/api/assets`
|
||||
and searched in memory; picked assets are stored on the package tagged
|
||||
`source:'catalog'` with the DB's own casing; anything not in the catalog is added by
|
||||
hand and visibly tagged manual. CSV import and Excel column paste bulk-add with the
|
||||
same matching. Unconfigured (`MICRON_DB_URL` unset) and unreachable are first-class
|
||||
states that degrade to manual entry — the suite runs without Micron wired up.
|
||||
|
||||
### What integration changed (and why)
|
||||
|
||||
The branch predates waves 5–9, so it used surfaces R2 replaced. Each adaptation keeps
|
||||
Cody's behaviour and moves it onto the R2 idiom:
|
||||
|
||||
1. **Six `alert()` calls → the T7.9 dialog kit and toast.** The creator ships zero
|
||||
native dialogs (`creator_dialogs_check` pins the count). File-handling errors use
|
||||
`toast(msg,'alert')` exactly as the drawings uploader and comment import do;
|
||||
the instructional message and the import summary use the kit, which gained the
|
||||
one-button `wpAlertDialog` shape it was always going to need (BL-024 wants it too).
|
||||
2. **The export block** moved inside T9.1's sectioned `add('assets', …)` frame, so the
|
||||
CR-006 assets toggle keeps governing it. Content is Cody's: two columns, Asset ID +
|
||||
Note, no controls.dev link column.
|
||||
3. **`initAssetPicker()`** joined the R2 `bootData()` loads rather than replacing them.
|
||||
4. **`role="status"`** on the picker's source note, so loading → ready/absent/error
|
||||
announces (C1, the login.html pattern).
|
||||
5. Everything else landed as written: his `⤒` import glyph is already the S6-mapped
|
||||
U+2912, `.material-actions` is the creator's own class, and the styles block
|
||||
declares no colour literal (`color_check` re-verifies).
|
||||
|
||||
### Recorded properties, restated as constraints
|
||||
|
||||
- **Read-only, structurally.** `assets_db.py` contains one SELECT and no other
|
||||
statement; there is no POST route. `assets_check` greps this on every run.
|
||||
- **Credentials are env-only** (`MICRON_DB_URL`), matching the SMTP password rule.
|
||||
Driver errors are logged server-side and never propagated to the browser, because
|
||||
a malformed URL's error text can quote password fragments.
|
||||
- **Unconfigured is not an error.** Local dev and the demo DB run with the picker in
|
||||
manual mode; nothing in the suite requires the catalog to exist.
|
||||
Reference in New Issue
Block a user