feat(slidewise): preview/edit mode preset + sidebar customization#50
Merged
Merged
Conversation
Adds a `mode="preview" | "edit"` preset on `SlidewiseEditor` / `SlidewiseFileEditor` that produces a fully inert viewer chrome (top bar trimmed to title + play, no add-slide button, no bottom toolbar, no Smart pill, `readOnly` set) while leaving every flag overridable. Per-flag props `hideAddButton`, `hideSlideNumbers`, and `hideSmart` are exposed at the top level too. Wires `readOnly` enforcement into the canvas: keyboard shortcuts (Delete / arrows / undo-redo / Enter), pointer-down on surface + elements, double-click text edit, and the grid overview's "+ New Slide" tile all bail when read-only. `SelectionFrame` and `FloatingToolbar` are skipped entirely as defense in depth. Adds `hideNumbers` and `thumbnailWidth` to `SlideRail` (and `hideNumber` / `thumbnailWidth` on `SlideRail.List`) so hosts can build wide preview-style sidebars or tray-style slide pickers without dropping to deeper compound composition. Adds `hideSmart` to `TopBar` and `TopBar.Title`.
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.
Summary
mode="preview" | "edit"preset onSlidewiseEditor/SlidewiseFileEditor."preview"produces a fully inert viewer: top bar shows only the title + play button, the side rail's "New Slide" button is hidden, the bottom toolbar is hidden, the Smart pill is hidden,readOnlyis set, and the canvas itself blocks selection / drag / text-edit / keyboard shortcuts. Per-flag props still override the preset.readOnlyenforcement through the canvas (previously chrome-only): keydown (Delete/arrows/undo-redo/Enter), pointer-down on surface and elements, double-click text edit, the grid overview's "+ New Slide" tile, plus skippingSelectionFrameandFloatingToolbarrendering as defense in depth.SlidewiseEditor/SlidewiseFileEditor:hideAddButton,hideSlideNumbers,hideSmart.SlideRailprops:hideNumbers,thumbnailWidth. Threads throughSlideRail.List(hideNumber,thumbnailWidth) for hosts using deeper compound composition. Hosts can now build wide preview-style sidebars (e.g.width=420 thumbnailWidth=372) or tray pickers without dropping to subparts.TopBar/TopBar.Titleprop:hideSmart.website/src/App.tsxgets two new demo tabs (preview-mode,sidebar-only) so the new surface area is exercisable in the dev playground.@textcortex/slidewise.Out of scope (follow-ups)
Test plan
pnpm --filter @textcortex/slidewise exec tsc -p tsconfig.lib.json --noEmitcleanpnpm --filter website exec tsc -bcleanpnpm --filter @textcortex/slidewise test— 35 passed, 3 skippedDefaulttab still allows full editing (select / drag / text-edit / Delete / Cmd-Z / arrow nudge)Preview modetab — clicking elements does nothing, top bar shows only title + play, no add-slide button anywhere (rail or grid overview)Sidebar onlytab — wide rail with large stacked thumbnails, no chrome, no numbers, no add button