Skip to content

Receive a wanted title with a clear action, then open its new copy - #49

Merged
fabiodalez-dev merged 2 commits into
mainfrom
fix/wanted-receive-button
Oct 21, 2026
Merged

fabiodalez-dev merged 2 commits into
mainfrom
fix/wanted-receive-button

Conversation

@fabiodalez-dev

Copy link
Copy Markdown
Owner

Two changes to the donation offers in the admin area.

The wanted-title button is an action, not a status. In "Titoli cercati" each row had a trailing text button labelled "Ricevuto" (Received). It read as the title's state, so a book still wanted with 0 copies looked already received. One tap also added a copy straight away. The button now says "Ricevi" / "Receive" / "Empfangen" / "Recevoir", and it asks for confirmation before adding the copy.

After a receipt the new copy opens on the record. Receiving a wanted title or an offer creates a copy that still needs its inventory code and place. The app now opens the book record, scrolls to the copies and opens that copy's editor. The book editor route takes an optional copy argument for this.

Tests: DesiderataStaffFlowTest covers the confirm dialog (cancel sends nothing, confirm sends one request) and the jump to the new copy's editor for a wanted title, an offer for a wanted title and an offer received into a picked record. Full suites on the emulator: 93 instrumented and 389 unit tests pass.

On a wanted title the trailing "Ricevuto" (Received) read as a status, so a title still wanted with no copies looked already received, and one tap added a copy with no question. The button now says "Ricevi" (Receive) and asks before adding the copy.

Receiving a wanted title or an offer creates a copy that still needs its code and place. The app now opens the record, scrolls to the copies and opens that copy's editor straight away, through an optional copy argument on the book editor route.
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e7e17d9f-c435-4394-83ec-2b3ac2b76822
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — two rough edges in the new jump-to-copy flow, inline.

Reviewed changes

Reviewed the single commit that turns the wanted-title button into a confirmed action and routes every receipt to the new copy's editor.

  • Confirm before receiving a wanted title — the row button now reads as an action (staff_wanted_mark_received relabelled in all four locales), and askReceiveWanted / receiveWanted go through a ConfirmDialog.
  • openCopy hand-off — a successful wanted or offer receipt sets DesiderataUiState.openCopy, which the screen consumes and passes to the new onOpenCopy callback.
  • Optional copy route argument — STAFF_BOOK_EDIT gains ?copy={copyId} (default 0); existing staffBookEdit(id) callers still resolve to the same destination.
  • Auto-open in StaffCopiesSection — once the copy shows up in state.copies, the section scrolls into view and calls startEdit. StaffBookEditViewModel.openCopyId is cleared on first use, so recompositions and rotations don't reopen it.
  • Device tests — cancel sends nothing, confirm sends one request, and all three receipt paths land on copy-save.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

…record id out

A receipt response without book_id, or a received offer whose book has id 0,
fell back to staffBookEdit(0, copy), which opens the new-book form. Both now
fall back to the title being received. With labels but no per-copy area the
section still scrolls into view, but the copy editor stays closed.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. Both rough edges from the last review are closed.

Reviewed changes

Reviewed the single follow-up commit, which hardens the jump-to-copy flow.

  • Wanted receipt falls back to the received title — a bookId of 0 in WantedReceiveResult now resolves to book.id, so a response without book_id can no longer open the new-book form.
  • Offer receipt ignores 0 ids — receivedCopy takes receivedBook and then book only when the id is above 0. This matches OfferSheet.
  • Copy editor gated on areas.copies — the auto-open still consumes openCopyId and scrolls to the section, but it opens CopyEditorSheet only when per-copy management is on. staffAreas is seeded eagerly from current values, so this check sees the right flag on first composition.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

fabiodalez-dev added a commit that referenced this pull request Oct 21, 2026
Bumps the version and records in STATUS what 1.9.0 brings: closed digital files with their reason and signed-link renewal (#50), the restyled loan request sheet (#46), the return date from the server's loan duration (#51) and the wanted-title receive action (#49).
@fabiodalez-dev
fabiodalez-dev merged commit 106eb7d into main Oct 21, 2026
3 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