Skip to content

Conversation

@jhodapp
Copy link
Member

@jhodapp jhodapp commented Oct 18, 2025

Description

Enable full markdown interpretation in coaching notes editor, including markdown table paste support and enhanced link handling with keyboard shortcuts.

GitHub Issue: Closes #189

Changes

  • Markdown Table Support: Added markdown table parsing and rendering with @tiptap/extension-table integration

    • Created markdown-table-extension.tsx with custom parse/render handlers for marked.js
    • Added TableMarkdownPasteHandler extension for clipboard paste detection
    • Configured table with resizable: false due to known Yjs collaboration conflict
    • Added table styling in tiptap-table.scss with borders, padding, and header backgrounds
  • TipTap Extension Configuration Fixes:

    • Replaced StarterKit with individual extension imports to avoid History/Collaboration conflict
    • Added missing Underline extension (was referenced in toolbar but not configured)
    • Fixed TypeScript errors in link extension by explicitly defining attributes
  • Link Keyboard Shortcut (CMD+K / Ctrl+K):

    • Added LinkKeyboardShortcut extension for CMD+K/Ctrl+K support
    • Created shared triggerLinkCreation() utility to eliminate duplication between button and keyboard
    • Centralized zombie link cleanup into LinkZombieCleanup extension for consistent behavior
  • Code Quality:

    • Added comprehensive tests in coaching-notes-markdown-extensions.test.tsx (3 passing tests)
    • Tests cover markdown table conversion and autolink functionality
    • Removed duplicate cleanup logic from LinkBubbleMenu component

Screenshots / Videos Showing UI Changes (if applicable)

Markdown tables and links converted to rich text in light mode:
Screenshot 2025-10-18 at 22 04 49

Markdown tables and links converted to rich text in dark mode:
Screenshot 2025-10-18 at 22 05 45

Testing Strategy

Manual Testing:

  1. Paste markdown table (e.g., from GitHub) into coaching notes - should render as formatted table
  2. Highlight text → press CMD+K (Mac) or Ctrl+K (Windows) → bubble menu should appear
  3. Create link via CMD+K but don't enter URL → click away → zombie link should be automatically removed
  4. Verify underline button works in toolbar
  5. Check no console warnings for duplicate extensions or History/Collaboration conflicts

Some valid and invalid markdown tables and links for manual testing

// Simple valid table:
| Name | Age |
| ---  | --- |
| Alice | 30 |


// Empty table:
|     |
| --- |


// Empty header row table:
|     |         | 
| --- | ---     |
| Cell1 | Cell2 |


// Simple valid table but with leading spaces:
  | Name | Age |
  | ---  | --- |
  | Alice | 30 |


// Simple valid table but with different leading spaces:
  | Name | Age |
      | ---  | --- |
| Alice | 30 |



// Malformed table that looks like a table:
| Name | Age |
| Alice | 30 |


// Invalid table with leading tabs:
      | Name | Age |
      | --- | ---  |
      | Bob | 25   |

// Valid Markdown link with spaces
   [Example Title](https://example.com)

Automated Testing:

npm test -- __tests__/components/ui/coaching-sessions/coaching-notes/coaching-notes-markdown-extensions.test.tsx
npm run typecheck

Concerns

  • Extension Order: The LinkZombieCleanup extension must be loaded for proper empty link cleanup - ensure it's included in the extensions array.

…ng and rendering a markdown link and a markdown table
@jhodapp jhodapp added this to the 1.0.0-beta2 milestone Oct 18, 2025
@jhodapp jhodapp self-assigned this Oct 18, 2025
@jhodapp jhodapp added the feature work Specifically implementing a new feature label Oct 18, 2025
@jhodapp jhodapp moved this to 🏗 In progress in Refactor Coaching Platform Oct 18, 2025
@jhodapp jhodapp marked this pull request as ready for review October 19, 2025 02:56
@jhodapp jhodapp moved this from 🏗 In progress to Review in Refactor Coaching Platform Oct 19, 2025
@jhodapp jhodapp requested a review from calebbourg October 19, 2025 02:56
…mains applicable to only the local user, not across the collaboration session
Copy link
Collaborator

@calebbourg calebbourg left a comment

Choose a reason for hiding this comment

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

Just the one suggestion on toast messages. Otherwise looks great!

Comment on lines 331 to 332
if (error instanceof TypeError && error.message.includes("Expected table token")) {
toast.error("Unable to paste table. The table format may be invalid.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Matching on actual error output strings is usually fairly brittle in my own experience. This one seems pretty specific as well since, I would assume, user's will be using more than just tables. I like the generic toast message below. That, to me, would handle all cases well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yes good catch. I had Claude break this out into a general error function, but it didn't rework the overly specific error here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in 6fb18fc

Copy link
Collaborator

@calebbourg calebbourg left a comment

Choose a reason for hiding this comment

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

Looks great!

@jhodapp jhodapp merged commit 0cb24a1 into main Oct 22, 2025
6 checks passed
@jhodapp jhodapp deleted the 189-feature-enable-full-markdown-interpretation-in-coaching-notes branch October 22, 2025 19:56
@github-project-automation github-project-automation bot moved this from Review to ✅ Done in Refactor Coaching Platform Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature work Specifically implementing a new feature

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[Feature]: Enable full Markdown interpretation in Coaching Notes

2 participants