Skip to content

Add @-mention and Notion-style UX quick wins#10

Open
namedgraph wants to merge 1 commit into
masterfrom
notion-affordances
Open

Add @-mention and Notion-style UX quick wins#10
namedgraph wants to merge 1 commit into
masterfrom
notion-affordances

Conversation

@namedgraph

Copy link
Copy Markdown
Member

Borrow the Notion affordances worth stealing, reinterpreting @-mention as an RDF relation-authoring gesture.

  • @-mention (src/mention.xsl): typing @ at a word boundary opens a picker with an explicit predicate (from the vocabularies) and an object IRI autocompleted from document resources, vocab class terms, or free-form entry. Emits label - a real (subject, P, object-IRI) triple, reusing local:wrap-range / local:apply-annotation. No extractor change.
  • Slash menu (/): caret popup in an empty block that converts/inserts any block kind, reusing convert-block, the list builder and the figure/table dialogs.
  • Markdown input rules: '# '/'## '/'### ', '- '/'* ', '1. ', '> ', ``` in an empty paragraph.
  • Block-handle menu: click the gutter handle for Turn into / Duplicate / Delete (turn-into disabled on structure-locked list/figure/table blocks).

Shared foundation: one higher-priority ixsl:onbeforeinput dispatcher routes the printable-char triggers and next-matches into undo.xsl's coalescer, so plain typing still snapshots for undo. local:show-at is split into a reusable show-at-point (+ show-at-caret/-element) for the keyboard-triggered popups. local:convert-block becomes a pure primitive (caller owns the undo snapshot), which also fixes a dangling element-level caret after replaceWith on empty blocks.

Tests: new tests/browser/notion.mjs (26 assertions) registered in run.mjs; make test and make test-browser both green.

Borrow the Notion affordances worth stealing, reinterpreting @-mention as an
RDF relation-authoring gesture.

- @-mention (src/mention.xsl): typing @ at a word boundary opens a picker with
  an explicit predicate (from the vocabularies) and an object IRI autocompleted
  from document resources, vocab class terms, or free-form entry. Emits
  <span property="P" resource="O">label</span> - a real (subject, P, object-IRI)
  triple, reusing local:wrap-range / local:apply-annotation. No extractor change.
- Slash menu (/): caret popup in an empty block that converts/inserts any block
  kind, reusing convert-block, the list builder and the figure/table dialogs.
- Markdown input rules: '# '/'## '/'### ', '- '/'* ', '1. ', '> ', ``` in an
  empty paragraph.
- Block-handle menu: click the gutter handle for Turn into / Duplicate / Delete
  (turn-into disabled on structure-locked list/figure/table blocks).

Shared foundation: one higher-priority ixsl:onbeforeinput dispatcher routes the
printable-char triggers and next-matches into undo.xsl's coalescer, so plain
typing still snapshots for undo. local:show-at is split into a reusable
show-at-point (+ show-at-caret/-element) for the keyboard-triggered popups.
local:convert-block becomes a pure primitive (caller owns the undo snapshot),
which also fixes a dangling element-level caret after replaceWith on empty blocks.

Tests: new tests/browser/notion.mjs (26 assertions) registered in run.mjs;
make test and make test-browser both green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@namedgraph namedgraph force-pushed the notion-affordances branch from 062fba9 to 7b36f12 Compare July 7, 2026 19:37
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