Repository navigation
feat: Save as…, with a public copy of the deck to hand out - #12
Merged
Merged
Conversation
The Save as button in the edit view makes a public copy: the deck as it is now under a name of its own, without the speaker notes, the skipped slides, the layouts and the comments between the slides. It says what it leaves out first. The copy opens without the edit view, and an engine inlined in it loses the code of that view.
Save opens a menu with Save and Save public copy…, each saying what it does; the public copy's line says what it leaves out. Cmd/Ctrl+S still saves straight away. The menu looks like the layouts menu, and a button whose menu is open stays lit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey Roald, glad you liked the previous PRs 🙌 It's a pleasure to work on this.
Here's the one for #9, as you suggested 🙂
What it does
A button in the edit view makes a public copy of the deck to hand out: the deck as it is now, without the speaker notes, the skipped slides, the layouts and the comments between the slides.
name-public.htmlsuggested; elsewhere it downloads it.How the trimming works
As described in the issue: two marker comments in
deck.jsaround the edit view, and the copy cuts what is between them. Without the markers the copy simply keeps the whole engine, and still has no edit view. The test opens a public copy and checks that it is under 60% of the size, has none of the edit view's functions, navigates and throws no errors.It's the small version on purpose. If you'd like the engine properly split in two blocks, viewer and editor, so that a copy just drops a block, I'd be glad to do it as a separate PR. It touches
update, the template and existing decks, so I didn't want to slip it in here.One difference from the issue
The button is called Save as… instead of "Public copy", and the public copy is the one choice in its panel. I have a follow-up about Save itself (see below) where a full copy joins it, and this way the button doesn't change name between two releases. If you'd rather have a plain "Public copy" button for now, that's a two-line change.
What comes next
While working on this I kept tripping over Save: it's easy to write a copy into Downloads without noticing. I have a fix that builds on this PR, with Save writing to the deck's own file and Save as… making the copies. It's a bigger change to how Save behaves, so I'll open it as its own PR once this one is in, and you can judge each on its own. The branch is here if you're curious: https://github.com/victorbahl/deckfile/tree/feat/save-to-deck-file
Testing
npm test: 13 node tests and 106 browser tests pass. One browser test is new: it makes a public copy through a stand-in dialog and as a download, then opens it and checks that it navigates, has no edit view and throws no errors. Checked by hand in Chrome on macOS.Closes #9