Skip to content

feat(apollo-react): add markdown formatting utilities for sticky notes (1/3) [MST-7636]#427

Open
david-rios-uipath wants to merge 1 commit intomainfrom
feat/sticky-note-markdown-formatting
Open

feat(apollo-react): add markdown formatting utilities for sticky notes (1/3) [MST-7636]#427
david-rios-uipath wants to merge 1 commit intomainfrom
feat/sticky-note-markdown-formatting

Conversation

@david-rios-uipath
Copy link
Copy Markdown
Contributor

@david-rios-uipath david-rios-uipath commented Mar 31, 2026

Summary

NOTE: this PR is focused on the formatting/interaction logic that's consumed by the sticky note markdown toolbar in the top PR.

Adds markdown editor logic to support bold, italic, strikethrough, bullet lists, and numbered lists.

Final UI (both PRs):
image

2026-03-30.17.37.18.mp4

Changes

  • Smart toggle — clicking a format button when cursor is inside a formatted region removes the markers instead of inserting redundant ones
  • Bold+italic detection — correctly detects and toggles ***combined*** markers in toolbar state
  • List-aware formatting — applies inline formatting per-line in lists, protecting - and N. prefixes from being wrapped
  • Enter key list continuation — auto-inserts next bullet/number on Enter; exits list on empty item
  • Line-scoped detection — format detection respects line boundaries to prevent cross-line false positives

Flow

flowchart TD
    A[User action: click toolbar / keyboard shortcut] --> B{Has selection?}
    B -->|No| C{Cursor inside formatted region?}
    C -->|Yes| D[Remove surrounding markers]
    C -->|No| E{On list line?}
    E -->|Yes| F[Wrap line content after prefix]
    E -->|No| G[Insert empty markers at cursor]
    B -->|Yes| H{Multi-line with list items?}
    H -->|Yes| I[Apply formatting per-line, protect prefixes]
    H -->|No| J[Wrap/unwrap selection]
    D --> K[Update activeFormats + set cursor via rAF]
    F --> K
    G --> K
    I --> K
    J --> K
Loading

Testing

  • pnpm run test passes (67 suites, 1344 tests)
  • pnpm run typecheck passes
  • pnpm run lint passes
  • Manual testing performed
  • Unit tests added (61 tests for markdownFormatting, 10 for FormattingToolbar component)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (PT)
apollo-canvas 🟢 Ready Preview, Logs Apr 01, 2026, 07:19:32 PM
apollo-landing 🟢 Ready Preview, Logs Apr 01, 2026, 07:17:03 PM
apollo-ui-react 🟢 Ready Preview, Logs Apr 01, 2026, 07:18:30 PM
apollo-vertex 🟢 Ready Preview, Logs Apr 01, 2026, 07:17:56 PM
apollo-wind 🟢 Ready Preview, Logs Apr 01, 2026, 07:18:04 PM

@github-actions github-actions bot added the size:XL 500-999 changed lines. label Mar 31, 2026
@github-actions
Copy link
Copy Markdown

Dependency License Review

  • 1924 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 3 package(s) excluded (see details below)
License distribution
License Packages
MIT 1689
ISC 89
Apache-2.0 56
BSD-3-Clause 28
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 5
MIT OR Apache-2.0 3
MIT-0 3
CC0-1.0 3
LGPL-3.0-or-later 2
(MIT OR Apache-2.0) 2
Unlicense 2
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.2.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
@img/sharp-libvips-linuxmusl-x64 1.2.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

@david-rios-uipath david-rios-uipath marked this pull request as draft March 31, 2026 14:10
@david-rios-uipath
Copy link
Copy Markdown
Contributor Author

david-rios-uipath commented Mar 31, 2026

@david-rios-uipath david-rios-uipath changed the title feat(apollo-react): add markdown formatting utilities for sticky notes feat(apollo-react): add markdown formatting utilities for sticky notes (1/2) Mar 31, 2026
@david-rios-uipath david-rios-uipath force-pushed the feat/sticky-note-markdown-formatting branch 2 times, most recently from ca92f6e to 15037a1 Compare March 31, 2026 14:19
@david-rios-uipath david-rios-uipath marked this pull request as ready for review March 31, 2026 14:24
@david-rios-uipath david-rios-uipath changed the title feat(apollo-react): add markdown formatting utilities for sticky notes (1/2) feat(apollo-react): add markdown formatting utilities for sticky notes (1/3) Mar 31, 2026
@david-rios-uipath david-rios-uipath changed the title feat(apollo-react): add markdown formatting utilities for sticky notes (1/3) feat(apollo-react): add markdown formatting utilities for sticky notes (1/3) [MST-7636] Mar 31, 2026
Add pure utility functions for inline markdown formatting and list
management, extracted into a markdown-formatting/ module.

- toggleBold/toggleItalic/toggleStrikethrough with smart unwrap
- toggleBulletList/toggleNumberedList with prefix-aware toggling
- continueListOnEnter with auto-increment and empty-item exit
- detectActiveFormats for cursor-position-aware format detection
- List-aware inline formatting that protects bullet/number prefixes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@david-rios-uipath david-rios-uipath force-pushed the feat/sticky-note-markdown-formatting branch from 15037a1 to 870f3d6 Compare April 2, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant