Skip to content

Delete Copy's dead no_draft refusal; a draft view copies what it shows - #1721

Merged
haowjy merged 4 commits into
mainfrom
fix/copy-draft-view-never-refused
Nov 16, 2026
Merged

haowjy merged 4 commits into
mainfrom
fix/copy-draft-view-never-refused

Conversation

@haowjy

@haowjy haowjy commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Changelog

  • Removed: The "That Work no longer has a draft of it" Copy refusal and its reason code no_draft, which the server never sent.

Why

The contract, the client and the docs said a Copy from a Work's Draft view (a tab under review, or the sidebar on Draft) is refused in two cases: when the Work holds no draft of the document (no_draft), and for any folder. The coder ran the unchanged server and found it never refuses either. A folder copies each document as the Work shows it, and a document with no draft copies its live text. The refusals existed only as stale text. This PR deletes them and corrects the docs, so no one builds against a refusal that doesn't exist.

Examples

Nothing a writer sees changes. The browser run (agent-browser, mock provider, on 44fba85, which differs only in also showing the note dropped below) showed:

  • a folder in Draft view copies drafted text for drafted documents and live text for the rest;
  • a single undrafted document copies its live text;
  • a drafted document copies its draft.

Folder copied in Draft view

Benchmarks

None.

Design decisions

  1. No note saying the copy came from live text. In Draft view, a document the Work has no draft of shows its live text, so the copy is exactly what the writer saw. A note would explain something unsurprising, and it needed a success toast, which the app's one toast surface rules out. Ruled out: a fromLive count on the answer with a toast (built in 44fba85, then dropped), and a marker on the copied rows.

Changes

# Part Why it's here Key paths Source Tests Docs
1 no_draft removed Dead reason in the contract and the client context-operation.ts, entry-failure.ts, locale catalogs see diff 0 0
2 Docs The rule says a draft view never refuses for lack of a draft context/.context/CONTEXT.md, qa/copy-server.md, qa/drag-sources.md, KB placement-and-naming.md 0 0 see diff

Compatibility and risk

  • Breaking or changed for writers: none.
  • Migrations and state: none.
  • Clients during a deploy: the server never sent no_draft, so no tab can receive it.
  • Rollback: a plain revert.
  • Where to look: context-operation.ts.

Verification

  • Browser: the run described under Examples.
  • Model: none; Copy calls no model.
  • Tests: none added.
  • Gates: pnpm check and pnpm test:db on 44fba85; typecheck and check:i18n on 849263c; CI 10/10 on b0a0529 (adds the two doc lines review p18396 found).

Deferred

None.

References

A document the Work holds no draft of shows its live text in Draft view, so copying that text
is what the writer saw. Drop the fromLive count, the note toast and the success-toast exception;
keep the deletion of the dead no_draft refusal.
@haowjy haowjy changed the title Copy from a Work's Draft view never refuses Delete Copy's dead no_draft refusal; a draft view copies what it shows Nov 16, 2026
@haowjy
haowjy marked this pull request as ready for review November 16, 2026 17:20
@haowjy

haowjy commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

Tree lead sign-off: review p18396 confirmed from the code that a draft view never refuses (effective-document-reader falls back to live; viewForOwner gives live with no branch). It found two stale doc lines, fixed in b0a0529. No writer-visible change: the server behaviour is unchanged, and only dead refusal text is removed. The coder's browser run on 44fba85 covers the Copy flows. CI 10/10.

@haowjy
haowjy merged commit 63f3e32 into main Nov 16, 2026
11 checks passed
@haowjy
haowjy deleted the fix/copy-draft-view-never-refused branch November 16, 2026 17:33
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