Skip to content

feat(slidewise): preview/edit mode preset + sidebar customization#50

Merged
karthikmudunuri merged 1 commit into
mainfrom
karthikmudunuri/preview-edit-props
May 15, 2026
Merged

feat(slidewise): preview/edit mode preset + sidebar customization#50
karthikmudunuri merged 1 commit into
mainfrom
karthikmudunuri/preview-edit-props

Conversation

@karthikmudunuri
Copy link
Copy Markdown
Member

Summary

  • Adds mode="preview" | "edit" preset on SlidewiseEditor / 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, readOnly is set, and the canvas itself blocks selection / drag / text-edit / keyboard shortcuts. Per-flag props still override the preset.
  • Wires readOnly enforcement 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 skipping SelectionFrame and FloatingToolbar rendering as defense in depth.
  • New top-level props on SlidewiseEditor / SlidewiseFileEditor: hideAddButton, hideSlideNumbers, hideSmart.
  • New SlideRail props: hideNumbers, thumbnailWidth. Threads through SlideRail.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.
  • New TopBar / TopBar.Title prop: hideSmart.
  • website/src/App.tsx gets two new demo tabs (preview-mode, sidebar-only) so the new surface area is exercisable in the dev playground.
  • Changeset: minor bump for @textcortex/slidewise.

Out of scope (follow-ups)

  • Light/dark CSS token audit — deferred at user's request; current dark token coverage unchanged.
  • Wheel-zoom is intentionally still live in preview (view-only, non-mutating).

Test plan

  • pnpm --filter @textcortex/slidewise exec tsc -p tsconfig.lib.json --noEmit clean
  • pnpm --filter website exec tsc -b clean
  • pnpm --filter @textcortex/slidewise test — 35 passed, 3 skipped
  • Local dev: Default tab still allows full editing (select / drag / text-edit / Delete / Cmd-Z / arrow nudge)
  • Local dev: Preview mode tab — clicking elements does nothing, top bar shows only title + play, no add-slide button anywhere (rail or grid overview)
  • Local dev: Sidebar only tab — wide rail with large stacked thumbnails, no chrome, no numbers, no add button

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`.
@karthikmudunuri karthikmudunuri merged commit a0f1511 into main May 15, 2026
1 check 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