Repository navigation
Document edit mode - #1455
Document edit mode#1455dnass wants to merge 22 commits into
Conversation
|
Preview deployed: https://preview-1455.staging.documentcloud.org |
| const viewport = page.getViewport({ scale }); | ||
| const viewport = page.getViewport({ | ||
| scale, | ||
| rotation: normalizeAngle(page.rotate + rotation), |
There was a problem hiding this comment.
We're no longer ignoring rotation when rendering pages here, so all uploads with rotated pages will be drawn correctly, not just ones modified through the API.
|
The menu is getting a little crowded with
Maybe we need the breakpoint to kick in sooner. |
|
I like the dropdown, and I agree calling it Modify? Write? Do things? Annotate is also different from the other two, in that it adds to the document and is reversible. I think it belongs, but it's not really a modification in the same way as redactions or page edits. |
|
"Write" could imply text editing, which isn't supported. Modify probably encompasses everything the best. |
|
Or we call the menu "Edit" and the button "Modify" but then maybe we have to change the mode name, too. (Naming things is hard.) |
|
Yeah, I'm trying to think about which term feels more appropriate for which thing and it's a tossup. Leaning slightly towards edit as the name of the mode, because it's a slightly friendlier/more familiar term and users will spend more time with the mode than the menu heading. |
|
Go with your gut and we can always adjust later. |


This introduces two new modes to the document viewer:
editis for modifying individual pages in the document layout, andbulkis for modifying multiple pages at a time in grid layout. Both modes push edits onto the same history stack, so users can switch between modes seamlessly while editing.Both modes can be reached via the Edit action in the reading toolbar. From the Pages view, this opens bulk mode. From any other view, it opens edit mode.

Once editing, users can switch between edit and bulk mode with the File and Pages toggles.

Both modes display a toolbar with discard, undo, and save actions.

Edit mode
Edit mode displays the edit toolbar in place of the page actions menu. It supports moving a page up or down one space, rotating, duplicating, and deleting.
Bulk mode
Bulk mode displays the edit toolbar in the footer, along with a select all control. It supports rotating, duplicating, and deleting one or more pages.
Notes
Octicons doesn't include rotate icons, so I added
@lucide/svelteas a dependency. I used Lucide for all of the edit actions for visual consistency.Below 56rem, redact, annotate, and edit controls are condensed into a single Modify menu:
Todo
I'll add two more PRs to this stack: