Skip to content

Editor improvements#18

Merged
usamaasfar merged 6 commits intomainfrom
editor-improvements
Feb 21, 2026
Merged

Editor improvements#18
usamaasfar merged 6 commits intomainfrom
editor-improvements

Conversation

@usamaasfar
Copy link
Owner

@usamaasfar usamaasfar commented Feb 21, 2026

Greptile Summary

This PR enhances the editor's markdown input rules and improves the overall writing experience with visual refinements.

Key Changes:

  • Added custom inline markdown input rules (*bold*, _italic_, ~~strikethrough~~, `code`) that trigger after space or end of line
  • Added horizontal rule support (---) and underline mark with Cmd+U shortcut
  • Implemented title fade-in/out animation on file switch and hover using new useTitleVisibility hook
  • Disabled autocomplete and spellcheck on the rename input for cleaner UX
  • Added Cmd+Enter as alternative shortcut for hard line breaks (in addition to Shift+Enter)
  • Refined editor spacing: reduced paragraph margins (0.75em → 0.5em), adjusted line-height (1.7 → 1.75), removed top margin from first headings
  • Added fade-in animation when editor mounts (120ms transition)

Note: Underline formatting is supported in the editor but is not preserved when serializing to markdown (rendered as plain text in saved files).

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes are well-implemented polish improvements to the editor with no logical errors or security concerns. The inline markdown rules issue mentioned in previous threads was already fixed in commit d8d2d07. The useTitleVisibility hook has proper cleanup, and all CSS transitions are straightforward.
  • No files require special attention

Important Files Changed

Filename Overview
apps/desktop/src/hooks/useTitleVisibility.ts New hook added to flash title visibility on file switch, clean implementation with proper cleanup
apps/desktop/src/App.tsx Integrates title visibility hook and disables autocomplete/spellcheck on rename input
apps/desktop/src/editor/markdown.ts Adds underline mark support with DOM serialization (underline lost when serializing to markdown)
apps/desktop/src/editor/Editor.tsx Adds custom inline mark input rules, horizontal rule support, underline mark, and Cmd+Enter for line breaks

Last reviewed commit: d8d2d07

usamaasfar and others added 2 commits February 22, 2026 00:59
- Add inline mark input rules: _italic_, *bold*, ~strikethrough~, `code`
- Add Cmd+Enter as hard break (alongside Shift+Enter)
- Add underline mark with Cmd+U shortcut
- Add --- input rule to insert horizontal rule
- Restore caretPlugin (pulled from main)
- Fade-in animation on editor mount
- Remove first-heading top margin
- Tighten typography: line-height 1.75, paragraph spacing 0.5em

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@usamaasfar
Copy link
Owner Author

@codex[agent] review.

@Codex Codex AI mentioned this pull request Feb 21, 2026
@Codex
Copy link
Contributor

Codex AI commented Feb 21, 2026

@usamaasfar I've opened a new pull request, #19, to work on those changes. Once the pull request is ready, I'll request review from you.

Title is hidden by default and fades in (400ms) on topbar hover.
Untitled stays always visible as a nudge to rename.
Flashes visible for 1.2s on file switch via useTitleVisibility hook.
Stays visible while renaming.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@usamaasfar usamaasfar marked this pull request as ready for review February 21, 2026 19:41
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +56 to +60
markRule(/_([^_]+)_$/, em), // _italic_
markRule(/\*([^*]+)\*$/, strong), // *bold*
markRule(/~~([^~]+)~~$/, strikethrough), // ~~strikethrough~~
markRule(/~([^~]+)~$/, strikethrough), // ~strikethrough~
markRule(/`([^`]+)`$/, code), // `code`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline mark rules conflict - typing *bold* will match both the em rule on line 56 (_italic_) and the strong rule on line 57 (*bold*) because both use similar patterns, but more critically, these patterns use $ (end of string) which won't match mid-paragraph - the anchor $ means end of input, so typing *test* more text won't trigger the rule at all

Suggested change
markRule(/_([^_]+)_$/, em), // _italic_
markRule(/\*([^*]+)\*$/, strong), // *bold*
markRule(/~~([^~]+)~~$/, strikethrough), // ~~strikethrough~~
markRule(/~([^~]+)~$/, strikethrough), // ~strikethrough~
markRule(/`([^`]+)`$/, code), // `code`
// inline mark rules
markRule(/_([^_]+)_ /, em), // _italic_
markRule(/\*([^*]+)\* /, strong), // *bold*
markRule(/~~([^~]+)~~ /, strikethrough), // ~~strikethrough~~
markRule(/~([^~]+)~ /, strikethrough), // ~strikethrough~
markRule(/`([^`]+)` /, code), // `code`

@usamaasfar
Copy link
Owner Author

Greptile Summary

Enhanced editor writing experience with improved spacing, title visibility behavior, and markdown input rules. Title now hides by default and reveals on hover or file switch. Added support for inline markdown rules (*bold*, _italic_, `code`, ~~strikethrough~~), underline mark (Cmd+U), and Cmd+Enter for hard breaks. Improved editor mount animation and refined typography spacing.

Confidence Score: 2/5

  • This PR has a critical bug in the inline markdown input rules that will prevent them from working correctly
  • The inline mark input rules use $ anchor which matches end-of-string, preventing the rules from triggering when typing mid-paragraph. This means features like *bold* and _italic_ won't work as intended during normal typing. The rest of the changes (title visibility, spacing, underline support) are solid.
  • Pay close attention to apps/desktop/src/editor/Editor.tsx - the inline mark input rules need regex pattern fixes

Important Files Changed

Filename Overview
apps/desktop/src/editor/Editor.tsx Added inline markdown input rules, underline mark support, Cmd+Enter hard break, and mount animation - but inline mark rules have critical regex pattern issue with $ anchor
apps/desktop/src/hooks/useTitleVisibility.ts New hook that returns true briefly when file switches to flash title visible - clean implementation with proper cleanup
apps/desktop/src/App.tsx Integrated title visibility hook, disabled autocomplete/spellcheck on rename input, added CSS classes for title switching state
Last reviewed commit: ca47c3b

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@codex[agent] can you fix it.

@Codex
Copy link
Contributor

Codex AI commented Feb 21, 2026

@usamaasfar I've opened a new pull request, #21, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Fix inline markdown input rule anchors

---------

Co-authored-by: openai-code-agent[bot] <242516109+Codex@users.noreply.github.com>
@usamaasfar
Copy link
Owner Author

@greptile re-review, please.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@usamaasfar usamaasfar merged commit e3a47d5 into main Feb 21, 2026
@usamaasfar usamaasfar deleted the editor-improvements branch February 21, 2026 20:10
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.

2 participants