Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
629270d
docs: add approved inline text editing design spec
DavidBabinec Jun 10, 2026
f975e9a
feat(module-engine): add inlineTextEdit contract, declare on text/but…
DavidBabinec Jun 10, 2026
a0a7f24
feat(editor-store): add inline text edit session slice with coalesced…
DavidBabinec Jun 10, 2026
6bfcbf6
feat(editor-store): force-close inline edit sessions on deletion and …
DavidBabinec Jun 11, 2026
20edb1d
feat(canvas): add inline-edit typography mirroring helpers
DavidBabinec Jun 11, 2026
6bad4b7
feat(canvas): add InlineTextEditOverlay, mounted per breakpoint frame
DavidBabinec Jun 11, 2026
ee59e9f
feat(canvas): wire double-click inline editing and hide doubled text
DavidBabinec Jun 11, 2026
41b2575
docs: document canvas inline text editing (parent-doc overlay)
DavidBabinec Jun 11, 2026
a617084
docs: fix remaining stale slice counts in editor.md (11 -> 12)
DavidBabinec Jun 11, 2026
83bf384
docs: fix stale slice count in adminUi header comment (11 -> 12)
DavidBabinec Jun 11, 2026
7447335
Merge origin/main into feat/inline-text-editing
DavidBabinec Jun 11, 2026
6cfeb1a
fix(canvas): render canvas + inline-edit field in the site's fonts, n…
DavidBabinec Jun 11, 2026
61b3457
fix(canvas): stop inline-edit field scroll-shifting multi-line text
DavidBabinec Jun 11, 2026
b7b265a
fix(canvas): remove inline-edit open flash by positioning in a layout…
DavidBabinec Jun 11, 2026
a23853d
feat(canvas): rewrite inline text editing to edit the real element in…
DavidBabinec Jun 11, 2026
84b59ea
fix(canvas): stop React clobbering the inline-edit caret every keystroke
DavidBabinec Jun 11, 2026
4fe6f20
fix(canvas): let the spacebar type a space during inline editing
DavidBabinec Jun 11, 2026
3486ff0
fix(canvas): finalize inline editing — keyboard-forward guard, select…
DavidBabinec Jun 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(module-engine): add inlineTextEdit contract, declare on text/but…
…ton/link

Optional ModuleDefinition.inlineTextEdit { prop, multiline? } is the
extension point for canvas double-click inline editing — no per-module
branches in canvas code.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
  • Loading branch information
DavidBabinec and claude committed Jun 10, 2026
commit f975e9a63d476c11fa997173dbe3ff393da12724
29 changes: 29 additions & 0 deletions src/__tests__/base-modules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -826,3 +826,32 @@ describe('base.link — render() specifics', () => {
).not.toThrow()
})
})

// ---------------------------------------------------------------------------
// Inline text edit declarations (docs/superpowers/specs/
// 2026-06-10-inline-text-editing-design.md) — the canvas resolves these
// generically; the declaration IS the feature's per-module surface.
// ---------------------------------------------------------------------------

describe('inline text edit declarations', () => {
it('base.text edits the multiline `text` prop', () => {
expect(TextModule.inlineTextEdit).toEqual({ prop: 'text', multiline: true })
})

it('base.button edits the single-line `label` prop', () => {
expect(ButtonModule.inlineTextEdit).toEqual({ prop: 'label' })
})

it('base.link edits the single-line `text` prop (childless render path)', () => {
expect(LinkModule.inlineTextEdit).toEqual({ prop: 'text' })
})

it('every declared prop exists in the module schema with a string default', () => {
expect(Object.keys(TextModule.schema)).toContain('text')
expect(typeof TextModule.defaults.text).toBe('string')
expect(Object.keys(ButtonModule.schema)).toContain('label')
expect(typeof ButtonModule.defaults.label).toBe('string')
expect(Object.keys(LinkModule.schema)).toContain('text')
expect(typeof LinkModule.defaults.text).toBe('string')
})
})
12 changes: 12 additions & 0 deletions src/core/module-engine/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,18 @@ export interface ModuleDefinition<
*/
canHaveChildren: boolean

/**
* Opt-in canvas inline text editing (double-click a node on the canvas).
* `prop` names the single string prop the overlay edits; `multiline: true`
* renders a `<textarea>` instead of an `<input>`. Modules without this
* field keep the no-op double-click. The canvas resolves the contract
* generically — no per-module branches (a node with children never starts
* a session, which is how `base.link`'s children-over-text render rule is
* honoured). See docs/features/canvas-iframe-per-frame.md → "Inline text
* editing (parent-doc overlay)".
*/
inlineTextEdit?: { prop: string; multiline?: boolean }

/**
* How the publisher's node walker dispatches this module. Makes the
* otherwise-invisible two-tier render contract explicit on the definition:
Expand Down
1 change: 1 addition & 0 deletions src/modules/base/button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const ButtonModule: ModuleDefinition<ButtonStoredProps> = {
icon: CursorClickSolidIcon,
trusted: true,
canHaveChildren: false,
inlineTextEdit: { prop: 'label' },

schema: {
label: { type: 'text', label: 'Label', placeholder: 'Button text...' },
Expand Down
3 changes: 3 additions & 0 deletions src/modules/base/link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export const LinkModule: ModuleDefinition<LinkStoredProps> = {
icon: LinkIcon,
trusted: true,
canHaveChildren: true,
// Inline-editable only while childless — the canvas's generic
// children-guard mirrors linkUsesChildren() in render().
inlineTextEdit: { prop: 'text' },

schema: {
href: { type: 'url', label: 'URL' },
Expand Down
1 change: 1 addition & 0 deletions src/modules/base/text/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const TextModule: ModuleDefinition<TextStoredProps> = {
icon: TextStartTIcon,
trusted: true,
canHaveChildren: false,
inlineTextEdit: { prop: 'text', multiline: true },

schema: {
text: { type: 'textarea', label: 'Text', rows: 4, placeholder: 'Enter text...' },
Expand Down