Skip to content

Layout: manual editing, flowing text, new components and header/footer (lib 0.8.0-alpha.2) - #14

Merged
maxjneto merged 5 commits into
developfrom
feat/manual-editing-fixes
Nov 4, 2026
Merged

maxjneto merged 5 commits into
developfrom
feat/manual-editing-fixes

Conversation

@maxjneto

@maxjneto maxjneto commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Manual editing in layout documents, and the layout library 0.8.0-alpha.2 (vendored tarball; maxjneto/docforge-layout#1).

Manual editing

  • Shortcuts (Ctrl+Z/Y/C/X/V/D/S, Ctrl+/), double-click to edit, activity entries that say what changed, thin scrollbars.
  • Every block edited in place (cards, lists, steps, timelines, code, tables with Enter/Backspace/+), inline formatting bar, a content panel that reshapes instead of retyping.
  • Style any part of a block ("Apply to"), pick a part on the page, looks with a live preview.

Layout 0.8

  • Flowing text: one component whose blocks read top to bottom and split across pages; edited in the panel as a list of blocks.
  • New components in the Add and "/" menus: callout, tags, progress, cover, table of contents; charts with area, donut, scatter, horizontal and stacked bars; tables sized by content with a total row and bars; image captions and figure numbers; KPI sparkline.
  • Page panel: header and footer (document title, page numbers; every page or all but the first).
  • MCP tool descriptions mention flow, the master ops and the table width measure_component reports.

Documents stay in format 4; older ones are read as they were (tables in format 2/3 keep even columns). No migration.

Checks: frontend 102 tests, tokens, build; layout-service 18; MCP 23 + ruff.

… scrollbars

Manual editing in the layout editor was hard to use: double-clicking a block
never opened it, Ctrl+Z was swallowed by every text field (and inside them
took back one letter at a time), there was no copy/paste of blocks, the
Activity panel only said "edited", and most scrolling areas used the native
scrollbar.

- PageCanvas captures the pointer only once a drag starts, so click and
  double-click reach the block again (the capture at pointerdown sent them to
  the layer).
- Ctrl+Z/Y work from anywhere, including a clean content form (`data-undo`);
  panel fields no longer carry a React value/defaultValue, which Chrome
  answered by dropping the undo history on every keystroke.
- Ctrl+C/X/V/D copy, cut, paste and duplicate blocks through the system
  clipboard as JSON (plain text pastes as a text block); Ctrl+S opens
  "Save version"; Ctrl+/ lists the shortcuts.
- Every write carries a description (the same line the history shows), undo,
  redo and restore included; the backend accepts `note` on PUT /layout too.
- Activity shows the writer's description and folds bursts of edits by the
  same actor into one expandable line.
- One thin scrollbar for every scrolling area, and `color-scheme: dark` for
  native controls.
…t reshapes instead of retypes

Phase 2 of the manual-editing plan (notes/product/edicao-manual-e-atalhos.md).

- richText.ts: the library's inline text (markdown subset or runs) ⇄ editable
  HTML, so colors, highlights and links survive editing on the page. Runs are
  written back only when a run needs them; colors map to theme tokens.
- RunBar: a floating bar over any text selection (bold, italic, code, link,
  six token colors, highlight, clear, and the paragraph role for text blocks).
  Ctrl+B/I/K/Shift+H do the same.
- ParagraphsEditable + InlineField: the two editors every block shares. Their
  HTML is set once per edit: React 19 rewrites dangerouslySetInnerHTML on every
  render, which was wiping the browser's own edits.
- In-place editors for card, list (Enter/Backspace/Tab), steps and timeline
  (Enter moves on, adds at the end), code (Tab indents); the table adds a row on
  Enter at the last one, removes an empty row on Backspace, and has "+" buttons
  for a column and a row. Text blocks with explicit runs edit in place too.
- Content panel: text is one rich editor with the role in the margin; the table
  form only reshapes (columns with alignment and weight, rows, paste from a
  spreadsheet, options); cells are edited on the page.
- The side panel's left edge drags between 340 and 560 px, remembered per browser.
…ith a live preview (lib 0.8.0-alpha.1, format 4)

Phase 3 of the manual-editing plan.

- Appearance gets "Apply to": the whole block or one of its parts (a table's
  header and striped rows, a KPI's label and change, a card's eyebrow, title,
  value and footer, the steps' title and number, a timeline's date and title,
  the roles a text block uses). "Only this block" writes the part's own style
  (`styles` on the component, new in the library); "All: type" writes the
  document selector `type.part`. "Changed here" and its reset are per part.
- A second click inside the selected block picks the part under the pointer
  (the drawing now carries `data-part`); the bar lists the parts too; Esc goes
  back to the whole block. The part is outlined on the page with its name.
- Ready-made looks per block type, each saying what it changes; hovering shows
  it on the page without writing anything (the two-frame swap now returns to an
  already-loaded frame instead of waiting for a reload that never comes).
- Units on free values (px, ×), "0" instead of "none" for the border, the
  table's header and striped-rows switches also in Appearance.
- Library vendored at 0.8.0-alpha.1 (branch feat/styles-by-part): `styles` per
  part, `table.zebra` and `steps.number` parts, `update.styles`, format 4 with
  the step down to 3. Backend writes format 4 and serves older readers through
  the downgrade as before.
- No colour literals in the run bar and the rich-text helpers (token guard).
…ditor (lib 0.8.0-alpha.2)

- The Add and "/" menus offer flowing text, callout, tags, progress, cover and
  table of contents, each with starter content and a content form.
- Flowing text is edited as its list of blocks: paragraphs and titles as text,
  page breaks as markers, other blocks as JSON; blocks move, go and are added.
- Charts gain area, donut and scatter, horizontal and stacked bars, legend on
  the right and axis titles; tables a "fit columns to content" switch, a total
  row, bars and spanning cells kept when reshaping; images a caption, figure
  numbers and a link; KPIs a sparkline; texts the display role.
- Page panel: "Header and footer" turns on the document title at the top and
  page numbers at the bottom, on every page or all but the first, and keeps
  what an agent put in the master. The page form no longer counts the master
  as a change.
- "Apply to" lists only the parts a block has (a table's footer when it has
  one, a callout's own kind).
- MCP: apply_layout_ops and measure_component describe flow, the master ops
  and the table width they measure.
- pt-BR and English strings for all of it.
@maxjneto
maxjneto merged commit 98e2ea2 into develop Nov 4, 2026
4 checks passed
@maxjneto
maxjneto deleted the feat/manual-editing-fixes branch November 4, 2026 02:18
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