Skip to content

Instantly share code, notes, and snippets.

@lucasfeijo
Last active April 5, 2023 18:01
Show Gist options
  • Save lucasfeijo/f3f9d757d6a1a6092b9c8c233acd6f3e to your computer and use it in GitHub Desktop.
Save lucasfeijo/f3f9d757d6a1a6092b9c8c233acd6f3e to your computer and use it in GitHub Desktop.
N&I Msg Composer™

New and Improved Composer™

Bugs we wanna squash from the old composer

  • 677 [macOS] Incorrect placement of text cursor indicator in message input if scrolling triggers
  • 679 [macOS] Adding an emoji in a message sometimes causes the cursor to move before the emoji
  • ??? [both] Incorrect initial size causes views to move and scroll to lag https://stackoverflow.com/questions/74045727/can-i-stop-nsviewrepresentable-layout-lag-for-nstextview
  • ??? [both] When a mention is broken down into two lines, the background color spreads over the whole paragraph
  • ??? [macOS] Undoing a mention only removes it partially (when undo is turned on)

Features

  • Rich text markdown parsing
    • Bold, underline, italics, etc
    • URLs auto clickable as links
  • Custom markdown tags for mentions
    • Parsing formatted text messages, convert custom markdown to mention attributes
  • Typeahead placeholders and replacing with tags
    • Typing @ creates a placeholder
    • Able to replace current placeholder with given tag
    • Auto clear placeholders when typing new one or continuing normal message
  • Cursor location
    • For scrollview to follow user focus
    • For typeahead box to anchor to
  • Disable editing and selection
    • When text is read only for example sent messages
  • Custom pb fonts and colors
  • Keyboard event handling
    • For selecting typeahead options with arrow keys
    • For sending messages with enter
    • Creating new lines with shift enter
    • Cancel typeahead with esc?
  • Custom text renderer
    • Mention tags with custom borders and such
    • Paragraph sizing and spacing from UX
  • Field Focus
    • Only read access for iOS composer UI behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment