Skip to content

Reminder display improvement in markdown editor#246

Draft
uphy wants to merge 14 commits intomasterfrom
feature/editor-reminder-display
Draft

Reminder display improvement in markdown editor#246
uphy wants to merge 14 commits intomasterfrom
feature/editor-reminder-display

Conversation

@uphy
Copy link
Copy Markdown
Owner

@uphy uphy commented Aug 4, 2025

image

TODO

  • PillWidget to svelte component
  • Replace css injection
  • Performance improvement (Avoid re-reading the entire document on every update. Currently, the whole text is re-parsed each time the caret moves or content changes)
  • Add setting to disable this extension
  • window.setInterval() to Obsidian's one
  • Simplify showDateTimeChooserModal() arguments (maybe we can omit step)
  • Documents

uphy added 14 commits August 3, 2025 16:57
…ter extension

- Add editor-reminder-display scaffolding with CM6 StateField, Decoration building, and PillWidget stub
- Inject CSS for pill styling and enable feature flag for Live Preview
- Provide recompute effect and selection preservation heuristics
- Wire extension into UI by registering in editor initialization
Introduce ReminderSpan type carrying columnStart/columnEnd.
Refactor formats to return ReminderSpan[] and implement computeSpan().
Update Content.getReminders to map spans to Reminder for consumers.
Adjust editor reminder pills and tests to use ReminderSpan-based parsing.
…sedown/touchstart and recomputing on selection change

Prevent the editor from moving the caret when interacting with the pill by:
- Adding mousedown handler with preventDefault/stopPropagation
- Adding touchstart handler (non-passive) with preventDefault/stopPropagation for mobile

Also trigger pill decoration recomputation when the selection changes to avoid stale suppression state.

Minor: update TODO comment to reflect selection updates.
…nts and remove legacy file

- Delete monolithic src/plugin/ui/editor-reminder-display.ts
- Add modular CM6 components under src/plugin/ui/editor-reminder-display/:
  - index.ts for exports
  - pill-widget.ts for widget rendering and activation
  - spans.ts for span derivation helpers
  - styles.ts for idempotent CSS injection
  - state-effects.ts for recompute effect
  - types.ts for shared types
- Improves maintainability and separation of concerns without changing behavior
…ensive checks and error handling

- Add guards and error handling in editor reminder pill extension to avoid crashes and invalid ranges
- Ensure RangeSetBuilder additions are ordered and validated
- Safeguard DOM interactions and event handling within PillWidget
- Improve selection preservation and document update flow
- Make span derivation resilient to malformed positions and missing data
- Inject styles defensively to handle non-DOM environments

These changes improve stability of Live Preview decorations and user interactions without altering behavior.
…mplify property access in editor reminder display
…y casts and optional chaining, with no functional changes
…rations across changes, and deferring recomputation
…and fix minute formatting

- Pass initialTime through modal and DateTime chooser to preselect current reminder time
- Use configured reminderTimeStep when opening chooser from editor pill
- Correct Moment.js minute token from HH:MM to HH:mm in ReminderListByDate
- Minor focus handling cleanup for editor reminder display
…e CSS injection

- Replace imperative DOM-based pill widget with ReminderPill.svelte
- Wire Svelte component into CodeMirror WidgetType and clean up on destroy
- Remove ensureReminderPillStylesInjected and styles.ts; co-locate styles in Svelte
- Improve activation handling via custom event and native click fallback
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