Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peritext laundry list #730

Open
streamich opened this issue Oct 28, 2024 · 0 comments
Open

Peritext laundry list #730

streamich opened this issue Oct 28, 2024 · 0 comments

Comments

@streamich
Copy link
Owner

streamich commented Oct 28, 2024

  • After marker insert, move the cursor in from of the marker.
  • Join cursors, which overlap (or are adjacent).
  • APIs for removing markers.
  • APIs for changing marker attributes.
  • Delete markers on Backspace clicks.
  • On blur grey out the cursors.
  • On focus make cursors active.
  • Add ability to blur the editor and to remove all cursors.
  • Create standartized slice annotations for:
    • bold
    • italic
    • etc.
  • Do not process mousemove events if coordinates don't change.
  • Setting cursor position to the current position, should not change block hashes.
  • Bug: add ability to set caret using mouse at to the very start or very end of text.
  • Block layer performance
    • Re-use old Block and LeafBlock instances.
    • Re-use old Inline instances.
    • Lazy compute ChunkSlices, only when necessary. (And cache?)
    • When rending Inline, memoize it based on hash.
      • Do not memoize on .text contents.
      • For the same hash, do not re-render all the renderers.
  • Inline formatting
    • When adding slice, expand selection as per Peritext paper (next char anchor).
    • Ability to remove formatting.
    • Ability to insert formatting into only a caret selection.
  • Read-only mode
    • Any mutations are disabled.
    • Kerning and font ligatures are re-enabled.
  • Block formatting
    • Support Enter paragraph splitting using the right DOM events.
    • Support line break insertion using Ctrl + Enter.
    • Support block splits, for all blocks, when not in paragraph block.
    • Support block deletion/merge.
    • Support block type change.
  • BUG: support input event composition when done through keyboard.
  • In cursor events, operate in the native CRDT coordinates.
  • Support rendering ABS start and end cursors.
    • BUG: cursor at ABS and is not included into block layer.
  • Support soft line detection in rendering layer.
  • Rendering surface
    • Implement some very basic defaults, such that, when no renderers are provided, the caret and selection are still visible.
  • Gracefully handle RESET event.
  • Add support for soft lines in events
  • Events
    • Insert events
      • Insert from clipboard
      • Insert from composition
      • Insert rich-text from clipboard
      • Insert Peritext rich-text
    • Delete events
      • Selection
      • Selection across slice boundaries
      • Selection across block boundaries
      • Delete backwards/forwards
      • Delete unit: (1) char; (2) word; (3) line
    • Cursor events
    • Clipboard events
    • Inline slice events
    • Block marker events
    • History events
    • Imperative APIs
  • Handle composition correctly
    • Deal with compositionstart, compositionupdate, and compositionend events.
  • Use contentvisibilityautostatechange event to not re-render invisible blocks.
  • Improve how renderers surround the root block element. React tree should not change because of the renderer changes.
  • Make the editor tabbable, add tabIndex={0}.
  • Inside coloured text, split the caret vertically in half and color top part in the color of the text and color the lower part in some color that matches the background.
  • Stackable (Many) slice annotations
    • Ability to register a metadata editor
    • Ability to preview changes without integrating them in main document
    • Dropdown listing all annotation at caret
      • Ability to select one
    • Ability to change selection range of picked annotation
    • Ability to insert
    • Ability to retrieve reference to it
    • Ability to modify its metadata
    • Ability to remove
    • Stretch: Ability to modify start and end positions
  • BUG: when deleting emojis, delete them all at once
  • BUG: long words are word-wrapped if caret is in the middle
  • BUG: next line pos is not found when caret at the very left edge of text
  • On multiple quick consecutive clicks extend selection in the following order: (1) word; (2) soft line; (3) hard line?; (4) block (what if it is the same as hard line?); (5) block and two adjacent blocks; (6) the whole document.
  • Separate context and <Editor> into their very own components, create state container. So that toolbar can be rendered in a very different place.
  • Named styles: user defined inline formatting combination which can be applied to text
  • Minimap
    • Render blocks according to their text size
    • and/or, render heading blocks

Paragraph (block element properties)

  • Text alignment
  • Indentation
  • Line height

Caret

  • Ability to change caret color
  • Ability for caret to hold state
  • Keep track and render fast typing score

Block side menu

  • Should be able to handle nested blocks

Caret hover menu

  • Close on Esc
  • Ability pick inline formatting
  • Ability to select formatting overlapping with caret

Selection hover menu

Clipboard module

  • Create a separate standalone module for managing clipboard operations.
  • Support old execCommand as well as navigator.clipboard APIs.
  • Make the clipboard module sufficiently generic, so it can work across multiple documents.
  • Make use, where possible, of DOM cut, copy, and paste events.
  • Use browser storage mechanism for complex clipboard data persistance.
    • Make storage interface pluggable.
  • Implement Peritext range serialization from CRDT coordinates to plain JSON.
  • Implement ability to insert JSON serialized content into a Peritext document.
  • Support parsing incoming rich-text paste events.
    • Inline formatting: (1) bold; (2) italic; (3) etc.
    • Images
  • Ability to render remote cursors

Undo/redo module

  • Implement undo and redo stacks.
  • Make the module sufficiently generic, so it can work across multiple documents.
  • Ability to store non-persistent events, such as mouse/cursor/view changes.

AI

  • Integrate web-llm
  • Autocompletion
  • Translation
  • Spellchecking
  • Rephrasing
image

Code blocks

  • Ability to color tokens of a code block.
  • Ability to select language
  • Ability to copy source
  • Show line numbers

Composition

Product feature investigation

Icons

Fragments

  • For plugins ability to render "fragment" (instead of "peritext")
  • Add ability to render selected fragment in read-only mode
  • Show/render selected fragment

Context menus

Context menu size toggle

  • Could be used for numeric rangers
    • Font size
    • Letter spacing
    • Word spacing
    • Line height
    • Text indent (for paragraph)
    • Text decoration thickness
image
@streamich streamich converted this from a draft issue Oct 28, 2024
@streamich streamich added this to the Rich-text rendering surface milestone Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress 🏎
Development

No branches or pull requests

1 participant