Skip to content

feat: Cmd+Enter to submit comments, Esc to close card#1

Open
nickmeinhold wants to merge 20 commits intomainfrom
feature/keyboard-shortcuts
Open

feat: Cmd+Enter to submit comments, Esc to close card#1
nickmeinhold wants to merge 20 commits intomainfrom
feature/keyboard-shortcuts

Conversation

@nickmeinhold
Copy link

Summary

  • Cmd/Ctrl+Enter submits comments from the TipTap rich text editor, via a new onModEnter callback prop on the Editor component and a handleKeyDown handler in editor props
  • Escape closes the card view and navigates back to the board, using the existing useKeyboardShortcut infrastructure — respects modal state (won't fire if a modal is open) and input focus (won't fire when typing in inputs/contentEditable)

Fixes kanbn#389, kanbn#390

Test plan

  • Open a card, type a comment, press Cmd+Enter (Mac) or Ctrl+Enter (Windows/Linux) — comment should submit
  • Verify Cmd+Enter doesn't interfere with slash commands or @mentions in the editor
  • Open a card, press Escape while not focused on any input — should navigate back to the board
  • Verify Escape while a modal is open (e.g. delete card confirmation) closes the modal, not the card
  • Verify Escape while typing in the TipTap editor does NOT close the card
  • Verify Escape shows up in the keyboard shortcut legend (Cmd+/)

🤖 Generated with Claude Code

nickmeinhold and others added 20 commits February 13, 2026 00:24
Add optional webhook functionality to notify external services
when cards are created, updated, moved, or deleted.

Configuration:
- WEBHOOK_URL: URL to POST webhook payloads to
- WEBHOOK_SECRET: Optional secret for HMAC signature verification

Webhook payload includes:
- Event type (card.created, card.updated, card.moved, card.deleted)
- Card data (id, title, description, dueDate, listId, boardId)
- User who performed the action
- Changes object (for updates) showing old/new values

The webhook is fire-and-forget (non-blocking) to avoid
impacting API response times. Failures are logged but don't
affect the main operation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 10s timeout to webhook fetch using AbortController
- Fix dueDate type to string (reflects JSON serialization)
- Remove email from user payload for privacy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add database schema for per-workspace webhook configuration:
- workspaceWebhooks table with url, secret, events, active fields
- Foreign keys to workspace and user tables
- Row-level security enabled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add repository functions for workspace webhooks:
- create, update, getByPublicId, hardDelete
- getAllByWorkspaceId for listing
- getActiveByWorkspaceId for sending webhooks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add new webhook utility functions:
- sendWebhookToUrl: Send to specific URL with result
- sendWebhooksForWorkspace: Query DB and send to all active webhooks
- Keep legacy sendWebhook for backwards compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add webhook router with endpoints:
- list: Get all webhooks for workspace
- create: Add new webhook
- update: Modify webhook settings
- delete: Remove webhook
- test: Send test payload

All endpoints require admin role.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update card create/update/delete to send webhooks to all
active workspace webhooks instead of just env var webhook.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add React components for webhook management:
- WebhookList: Table with edit/test/delete actions
- NewWebhookModal: Create/edit form with event checkboxes
- DeleteWebhookConfirmation: Confirmation dialog

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add WebhookSettings page with modals
- Add webhooks.tsx page route
- Add Webhooks tab to settings navigation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove WEBHOOK_URL/WEBHOOK_SECRET env var fallback.
Webhooks are now only configured via the database/UI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive test coverage for webhook functionality:
- webhook.test.ts: Tests for createCardWebhookPayload, sendWebhookToUrl,
  and sendWebhooksForWorkspace utility functions
- webhook.test.ts (router): Tests for list, create, update, delete, and
  test procedures including authorization checks

Also adds vitest to @kan/api package for running tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add integration tests that use a real in-memory PGlite database:
- test-db.ts: Helper to create fresh PGlite instances with migrations
- webhook.integration.test.ts: 14 tests covering all webhook repo CRUD ops

Integration tests verify actual database behavior vs mocked unit tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reset locale files to main and recompile. Webhook translation strings
will use English fallback until properly extracted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add name fields to existing Drizzle queries in list and card repos,
then pass them through to createCardWebhookPayload at all three
webhook call sites (create, update/move, delete).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The board.byId query was generating presigned S3 URLs for workspace
member avatars but not for card member avatars. This caused card avatars
to silently fall back to initials since the frontend helper returns ""
for raw S3 keys.

Closes kanbn#387

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two keyboard shortcuts for faster card interaction:
- Cmd/Ctrl+Enter submits comments from the TipTap editor
- Escape navigates back to the board from the card view (respects
  modal state and input focus)

Fixes kanbn#389, kanbn#390

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Add Cmd+Enter shortcut to submit comments

1 participant