Skip to content

fix(ui): make Done the main action once a title picture is set - #588

Merged
LeMyst merged 1 commit into
cooklang:mainfrom
LeMyst:fix/picture-dialog-actions
Sep 30, 2026
Merged

LeMyst merged 1 commit into
cooklang:mainfrom
LeMyst:fix/picture-dialog-actions

Conversation

@LeMyst

@LeMyst LeMyst commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #587.

After an upload, the title picture dialog kept Replace picture as its accent button. The upload is already saved at that point, so the obvious next click reopened the file picker instead of closing the dialog. With a picture set by the recipe's image: metadata, the only accent button was a disabled Choose picture.

Change

State Before After
No picture Close · Choose picture unchanged
Picture uploaded Remove · Close · Replace picture Remove ……… Replace picture · Done
Picture set by metadata Close · Choose picture (disabled) Done
  • Once the recipe has a picture, the close button reads Done and takes the accent; Replace picture becomes a plain button (clicking the preview still opens the picker too).
  • The main action is always the last button. renderPicture() moves the node rather than using CSS order, so tab order matches what is on screen.
  • Remove moves to the far left, apart from the main action. Its confirmation step is unchanged.
  • New action-done key in all eight locales.

Screenshots

Picture uploaded

Before After

Picture set by image: metadata

Before After

The empty state renders identically before and after.

Tests

  • tests/e2e/editor.spec.ts: the upload test now checks the visible buttons and which one is highlighted in the empty → uploaded → removed states, and a new test covers a metadata picture.
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test pass.
  • Playwright chromium: 240 passed. The 4 failures are in shopping-list-copy.spec.ts / shopping-list-live.spec.ts and fail the same way on an upstream main build in my environment; they don't touch the editor.

🤖 Generated with Claude Code

After an upload the picture dialog kept Replace picture as its accent
button, so the obvious next click reopened the file picker instead of
closing the dialog. With a picture set by the recipe's metadata, the
only accent button was a disabled Choose picture.

Once the recipe has a picture, Close becomes Done and takes the accent,
and Replace picture turns into a plain button. The main action is always
the last button, in tab order as on screen. Remove moves to the far
left, away from it. A metadata picture shows Done alone.

Closes cooklang#587

Co-Authored-By: Claude Opus 5.5 <[email protected]>
LeMyst added a commit to LeMyst/cookcli that referenced this pull request Sep 30, 2026
@LeMyst
LeMyst marked this pull request as ready for review September 30, 2026 07:23
@LeMyst
LeMyst merged commit efea22d into cooklang:main Sep 30, 2026
6 checks passed
@shsw228 shsw228 mentioned this pull request Sep 30, 2026
4 tasks done
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.

Title picture dialog: after an upload the highlighted button is Replace picture, not Done

1 participant