diff options
| author | grm <grm@eyesin.space> | 2026-09-17 18:54:33 +0300 |
|---|---|---|
| committer | grm <grm@eyesin.space> | 2026-09-17 18:54:33 +0300 |
| commit | 616aa3a934951260d5daa81ab3d0f93fbc94ebee (patch) | |
| tree | 76e96881a23d3e944cc3acbaf27a9217ca030a5a /AGENTS.md | |
| parent | f16bd0f79c624665580615321b5d13b4be27cdad (diff) | |
| download | blogspace-616aa3a934951260d5daa81ab3d0f93fbc94ebee.tar.gz blogspace-616aa3a934951260d5daa81ab3d0f93fbc94ebee.tar.bz2 blogspace-616aa3a934951260d5daa81ab3d0f93fbc94ebee.zip | |
Keep a chosen image older than the picker's list, and the layout on a rejected save
The image picker's select lists the newest recentImages library images and
was meant to add the chosen one when it is older than those, but the fallback
option was gated on the filename being unknown, which designData makes known:
the option never rendered, the browser selected "None", and every save of the
design form cleared a logo or favicon older than the 48 newest images (the
post form's featured image the same way). The partial now checks whether the
choice is listed and otherwise emits it, named.
handleDesign ran the uploads before parsing the module and menu rows and gave
up at the first problem, so a rejected upload rendered the form without any
rows — and, since a missing row means delete, the next save would have wiped
the layout and menu. Everything is read before the first problem is reported.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'AGENTS.md')
| -rw-r--r-- | AGENTS.md | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -144,7 +144,10 @@ internal/web/ server.go (host router, middleware, render helpers) the modules of every area (with their settings inline, folded in a `<details>`) and the menu — stored atomically by `BlogStore.SaveDesign` (theme + full module list + full menu in one transaction: rows with an id - are updated, without one inserted, missing ones deleted). Sections are cards + are updated, without one inserted, missing ones deleted). Because a missing + row means delete, `handleDesign` reads *everything* — modules, menu, then + the uploads — before reporting the first problem, and the rejected form is + rendered from all of it; never bail out half-way. Sections are cards with ids (`designSections`) a sticky side index jumps to; the hidden `at` field says which one was in view so the flash returns there. Module rows are `mod.<i>.{id,area,kind,title,body,count,pos,del}` and menu rows |
