Skip to content

Fix: restore all saved boards when editing an InvokeAI board album#336

Merged
lstein merged 2 commits into
masterfrom
lstein/fix/board-album-edit-selection
Jun 16, 2026
Merged

Fix: restore all saved boards when editing an InvokeAI board album#336
lstein merged 2 commits into
masterfrom
lstein/fix/board-album-edit-selection

Conversation

@lstein

@lstein lstein commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Bug

When editing a previously-saved InvokeAI board-backed album, the board checklist showed only "Uncategorized" checked, even though more boards (or all of them) had been selected and indexed successfully.

Root cause

populateBoardAlbumEditForm (album-manager.js) renders a placeholder checklist immediately — but with board names still unresolved, that render only paints the prepended "Uncategorized" box. It then kicks off the async loadBoards() to fetch the real list. The trouble was how loadBoards chose which boxes to check:

selectedIds: collectSelectedBoardIds(boardsContainer).length
  ? collectSelectedBoardIds(boardsContainer)   // reads the DOM → just ["none"]
  : album.invokeai_board_ids || [],            // the real saved list (skipped!)

When the saved selection included Uncategorized (none), the placeholder render left that box checked, so collectSelectedBoardIds() returned ["none"] (truthy) and the full album.invokeai_board_ids was never used. Every other saved board came back unchecked. (The bug only bit when none was among the saved boards — otherwise the DOM scrape returned [] and the fallback kicked in.)

Fix

loadBoards now takes an explicit preferredIds:

  • The initial auto-load passes album.invokeai_board_ids directly — no DOM scrape.
  • The manual "Connect & Load Boards" button passes the current in-DOM selection, so an in-progress edit isn't clobbered on reconnect.

Testing

  • New regression test reproduces the exact scenario (all boards incl. Uncategorized) — verified it fails without the fix, passes with it.
  • Added a test that manual reconnect preserves the user's in-progress selection.
  • npm test (381 tests), npm run lint, npm run format:check all clean.

🤖 Generated with Claude Code

lstein and others added 2 commits June 15, 2026 19:46
Reopening a board album for editing left only "Uncategorized" checked
when the saved selection included it. populateBoardAlbumEditForm paints a
placeholder checklist (board names unresolved) that shows only the checked
Uncategorized box, then auto-loads the real list. The auto-load derived
its selected ids from the DOM, which had collapsed to just ["none"], so
every other saved board came back unchecked.

The auto-load now passes the album's saved invokeai_board_ids directly;
only the manual "Connect & Load Boards" button reads the in-progress DOM
selection (so an in-flight edit isn't clobbered on reconnect).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lstein lstein enabled auto-merge (squash) June 16, 2026 02:17
@lstein lstein merged commit 91f2b8f into master Jun 16, 2026
10 checks passed
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