⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.
TypeScript agenticagileai-agentsbug-reportingbug-trackerganttissue-trackerjirajira-alternativekanbanlinearlinear-alternativeopen-sourceproduct-managementproject-managementroadmapself-hostedsprint-planningteam-collaborationtrello-alternative
feat(web): add inline checkboxes to issue descriptions (#656)
Karthik Kulkarni7bb8858ba94d
diff --git a/apps/web/messages/ar/common.json b/apps/web/messages/ar/common.jsonindex fc265d10..7242d41d 100644--- a/apps/web/messages/ar/common.json+++ b/apps/web/messages/ar/common.json@@ -198,7 +198,8 @@"copiedLink": "تم النسخ","editLink": "تعديل الرابط","retryPreview": "إعادة المحاولة",- "copyLinkFailed": "تعذّر نسخ الرابط. حدّد عنوان URL أعلاه وانسخه."+ "copyLinkFailed": "تعذّر نسخ الرابط. حدّد عنوان URL أعلاه وانسخه.",+ "todoList": "قائمة مهام"},"chart": {"download": "احفظ الرسم البياني",diff --git a/apps/web/messages/en/common.json b/apps/web/messages/en/common.jsonindex 3b266fc4..4b787480 100644--- a/apps/web/messages/en/common.json+++ b/apps/web/messages/en/common.json@@ -198,7 +198,8 @@"copiedLink": "Copied","editLink": "Edit link","retryPreview": "Try again",- "copyLinkFailed": "Could not copy the link. Select and copy the URL above."+ "copyLinkFailed": "Could not copy the link. Select and copy the URL above.",+ "todoList": "To-do list"},"chart": {"download": "Save chart",diff --git a/apps/web/messages/es-ES/common.json b/apps/web/messages/es-ES/common.jsonindex 3729fa73..6ce8e294 100644--- a/apps/web/messages/es-ES/common.json+++ b/apps/web/messages/es-ES/common.json@@ -198,7 +198,8 @@"copiedLink": "Copiado","editLink": "Editar enlace","retryPreview": "Intentar de nuevo",- "copyLinkFailed": "No se ha podido copiar el enlace. Selecciona y copia la URL de arriba."+ "copyLinkFailed": "No se ha podido copiar el enlace. Selecciona y copia la URL de arriba.",+ "todoList": "Lista de tareas"},"chart": {"download": "Guardar gráfico",diff --git a/apps/web/messages/fa/common.json b/apps/web/messages/fa/common.jsonindex 04a73eb0..5a4599c3 100644--- a/apps/web/messages/fa/common.json+++ b/apps/web/messages/fa/common.json@@ -198,7 +198,8 @@"copiedLink": "کپی شد","editLink": "ویرایش پیوند","retryPreview": "دوباره تلاش کنید",- "copyLinkFailed": "کپی پیوند ممکن نشد. نشانی بالا را انتخاب و کپی کنید."+ "copyLinkFailed": "کپی پیوند ممکن نشد. نشانی بالا را انتخاب و کپی کنید.",+ "todoList": "فهرست کارها"},"chart": {"download": "ذخیره نمودار",diff --git a/apps/web/messages/fr/common.json b/apps/web/messages/fr/common.jsonindex 7d7a0108..b95e55c1 100644--- a/apps/web/messages/fr/common.json+++ b/apps/web/messages/fr/common.json@@ -198,7 +198,8 @@"copiedLink": "Copié","editLink": "Modifier le lien","retryPreview": "Réessayer",- "copyLinkFailed": "Impossible de copier le lien. Sélectionnez et copiez l’URL ci-dessus."+ "copyLinkFailed": "Impossible de copier le lien. Sélectionnez et copiez l’URL ci-dessus.",+ "todoList": "Liste de tâches"},"chart": {"download": "Enregistrer le graphique",diff --git a/apps/web/messages/id/common.json b/apps/web/messages/id/common.jsonindex b26deb6f..2383c1b7 100644--- a/apps/web/messages/id/common.json+++ b/apps/web/messages/id/common.json@@ -198,7 +198,8 @@"copiedLink": "Tersalin","editLink": "Edit tautan","retryPreview": "Coba lagi",- "copyLinkFailed": "Tautan tidak dapat disalin. Pilih dan salin URL di atas."+ "copyLinkFailed": "Tautan tidak dapat disalin. Pilih dan salin URL di atas.",+ "todoList": "Daftar tugas"},"chart": {"download": "Simpan grafik",diff --git a/apps/web/messages/ko/common.json b/apps/web/messages/ko/common.jsonindex dce0e4a9..8c41466b 100644--- a/apps/web/messages/ko/common.json+++ b/apps/web/messages/ko/common.json@@ -198,7 +198,8 @@"copiedLink": "복사됨","editLink": "링크 편집","retryPreview": "다시 시도",- "copyLinkFailed": "링크를 복사할 수 없습니다. 위의 URL을 직접 선택하여 복사해 주세요."+ "copyLinkFailed": "링크를 복사할 수 없습니다. 위의 URL을 직접 선택하여 복사해 주세요.",+ "todoList": "할 일 목록"},"chart": {"download": "차트 저장",diff --git a/apps/web/messages/pt-BR/common.json b/apps/web/messages/pt-BR/common.jsonindex b151c958..f8ab6e55 100644--- a/apps/web/messages/pt-BR/common.json+++ b/apps/web/messages/pt-BR/common.json@@ -198,7 +198,8 @@"copiedLink": "Copiado","editLink": "Editar link","retryPreview": "Tentar novamente",- "copyLinkFailed": "Não foi possível copiar o link. Selecione e copie a URL acima."+ "copyLinkFailed": "Não foi possível copiar o link. Selecione e copie a URL acima.",+ "todoList": "Lista de tarefas"},"chart": {"download": "Salvar gráfico",diff --git a/apps/web/messages/ru/common.json b/apps/web/messages/ru/common.jsonindex 5a38d97a..d82b1b59 100644--- a/apps/web/messages/ru/common.json+++ b/apps/web/messages/ru/common.json@@ -198,7 +198,8 @@"copiedLink": "Скопировано","editLink": "Изменить ссылку","retryPreview": "Повторить",- "copyLinkFailed": "Не удалось скопировать ссылку. Выделите и скопируйте URL выше."+ "copyLinkFailed": "Не удалось скопировать ссылку. Выделите и скопируйте URL выше.",+ "todoList": "Список задач"},"chart": {"download": "Сохранить график",diff --git a/apps/web/messages/tr/common.json b/apps/web/messages/tr/common.jsonindex e6410d36..257b3453 100644--- a/apps/web/messages/tr/common.json+++ b/apps/web/messages/tr/common.json@@ -198,7 +198,8 @@"copiedLink": "Kopyalandı","editLink": "Bağlantıyı düzenle","retryPreview": "Tekrar dene",- "copyLinkFailed": "Bağlantı kopyalanamadı. Yukarıdaki URL'yi seçip kopyalayın."+ "copyLinkFailed": "Bağlantı kopyalanamadı. Yukarıdaki URL'yi seçip kopyalayın.",+ "todoList": "Yapılacaklar listesi"},"chart": {"download": "Grafiği kaydet",diff --git a/apps/web/messages/uk/common.json b/apps/web/messages/uk/common.jsonindex 87bb5d44..a4b467e0 100644--- a/apps/web/messages/uk/common.json+++ b/apps/web/messages/uk/common.json@@ -198,7 +198,8 @@"copiedLink": "Скопійовано","editLink": "Редагувати посилання","retryPreview": "Спробувати ще раз",- "copyLinkFailed": "Не вдалося скопіювати посилання. Виділіть і скопіюйте URL вище."+ "copyLinkFailed": "Не вдалося скопіювати посилання. Виділіть і скопіюйте URL вище.",+ "todoList": "Список завдань"},"chart": {"download": "Зберегти графік",diff --git a/apps/web/messages/zh-CN/common.json b/apps/web/messages/zh-CN/common.jsonindex 8a33858c..53e88764 100644--- a/apps/web/messages/zh-CN/common.json+++ b/apps/web/messages/zh-CN/common.json@@ -198,7 +198,8 @@"copiedLink": "已复制","editLink": "编辑链接","retryPreview": "重试",- "copyLinkFailed": "无法复制链接。请选择并复制上方的 URL。"+ "copyLinkFailed": "无法复制链接。请选择并复制上方的 URL。",+ "todoList": "待办列表"},"chart": {"download": "保存图表",diff --git a/apps/web/src/app/globals.css b/apps/web/src/app/globals.cssindex 1eed1a07..8f3ffe47 100644--- a/apps/web/src/app/globals.css+++ b/apps/web/src/app/globals.css@@ -583,6 +583,11 @@ a.issue-ref {.md-content ul[data-type='taskList'] input[type='checkbox'] {cursor: pointer;}+.md-content[contenteditable='false'] ul[data-type='taskList'] li > label,+.md-content[contenteditable='false'] ul[data-type='taskList'] input[type='checkbox'] {+ cursor: default;+ pointer-events: none;+}.md-content table {border-collapse: collapse;}diff --git a/apps/web/src/components/common/editor/EditorSelectionMenu.tsx b/apps/web/src/components/common/editor/EditorSelectionMenu.tsxindex 2753cc78..b024b6a2 100644--- a/apps/web/src/components/common/editor/EditorSelectionMenu.tsx+++ b/apps/web/src/components/common/editor/EditorSelectionMenu.tsx@@ -3,6 +3,7 @@ import { type Editor } from '@tiptap/react';import { BubbleMenu } from '@tiptap/react/menus';import {Bold,+ CheckSquare2,Code,Heading1,Heading2,@@ -78,6 +79,7 @@ const ITEMS: {export default function EditorSelectionMenu({editor,placement = 'top',+ taskList = false,children,}: {editor: Editor;@@ -85,6 +87,8 @@ export default function EditorSelectionMenu({// Above the selection by default. A field with a label right over it passes// "bottom" so the menu does not cover the label.placement?: 'top' | 'bottom';+ // Only where the task-list extensions are registered.+ taskList?: boolean;}) {const t = useTranslations('common.editor');return (@@ -102,6 +106,15 @@ export default function EditorSelectionMenu({<item.icon /></EditorToolbarButton>))}+ {taskList && (+ <EditorToolbarButton+ active={editor.isActive('taskList')}+ title={t('todoList')}+ onClick={() => editor.chain().focus().toggleTaskList().run()}+ >+ <CheckSquare2 />+ </EditorToolbarButton>+ )}{children}</BubbleMenu>);diff --git a/apps/web/src/components/common/editor/MarkdownEditor.test.ts b/apps/web/src/components/common/editor/MarkdownEditor.test.tsindex 13e87d7a..dce62d2a 100644--- a/apps/web/src/components/common/editor/MarkdownEditor.test.ts+++ b/apps/web/src/components/common/editor/MarkdownEditor.test.ts@@ -2,8 +2,10 @@ import assert from 'node:assert/strict';import { afterEach, beforeEach, describe, it } from 'node:test';import { Editor } from '@tiptap/core';import Link from '@tiptap/extension-link';+import TaskItem from '@tiptap/extension-task-item';import StarterKit from '@tiptap/starter-kit';import { Markdown } from 'tiptap-markdown';+import { TightTaskList } from './tiptap-task-list';import { JSDOM } from 'jsdom';import { editorStarterKitOptions } from './MarkdownEditor';import { openLinkOnModifierClick } from './modifierClickLink';@@ -332,4 +334,40 @@ describe('MarkdownEditor markdown round trip', () => {assert.notEqual(roundTripped, 'See https://example.com/spec for details.');editor.destroy();});++ it('round-trips checked and unchecked task list items', () => {+ const editor = new Editor({+ extensions: [+ StarterKit.configure(editorStarterKitOptions),+ TightTaskList,+ TaskItem.configure({ nested: true }),+ Markdown.configure({ html: true, linkify: true, breaks: true }),+ ],+ content: '- [ ] first\n- [x] second',+ });++ assert.equal(editor.storage.markdown.getMarkdown(), '- [ ] first\n- [x] second');+ editor.destroy();+ });++ it('reverts a checkbox change in a read-only editor', () => {+ const editor = new Editor({+ element: dom.window.document.querySelector('div')!,+ editable: false,+ extensions: [+ StarterKit.configure(editorStarterKitOptions),+ TightTaskList,+ TaskItem.configure({ nested: true }),+ Markdown.configure({ html: true, linkify: true, breaks: true }),+ ],+ content: '- [ ] first',+ });+ assert.equal(editor.view.dom.getAttribute('contenteditable'), 'false');+ const checkbox = editor.view.dom.querySelector<HTMLInputElement>('input[type="checkbox"]')!;+ checkbox.checked = true;+ checkbox.dispatchEvent(new dom.window.Event('change', { bubbles: true }));++ assert.equal(checkbox.checked, false);+ editor.destroy();+ });});diff --git a/apps/web/src/components/common/editor/MarkdownEditor.tsx b/apps/web/src/components/common/editor/MarkdownEditor.tsxindex f0a5660e..436eef09 100644--- a/apps/web/src/components/common/editor/MarkdownEditor.tsx+++ b/apps/web/src/components/common/editor/MarkdownEditor.tsx@@ -4,6 +4,7 @@ import { useEditor, EditorContent, type Editor } from '@tiptap/react';import StarterKit from '@tiptap/starter-kit';import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight';import { TableKit } from '@tiptap/extension-table';+import TaskItem from '@tiptap/extension-task-item';import Placeholder from '@tiptap/extension-placeholder';import Link from '@tiptap/extension-link';import { common, createLowlight } from 'lowlight';@@ -17,6 +18,7 @@ import { IssueRef } from './issueRefDecorations';import { refreshDecorations } from './refreshDecorations';import { SlashCommand } from '@/lib/tiptap-slash-command';import { MarkdownTable } from './tiptap-table';+import { TightTaskList } from './tiptap-task-list';import { Video } from './tiptap-video';import { attachmentHtml, type Embeddable } from './attachmentEmbed';import { openLinkOnModifierClick } from './modifierClickLink';@@ -154,8 +156,11 @@ export default function MarkdownEditor({// column would be lost the next time the description is read back.TableKit.configure({ table: false }),MarkdownTable.configure({ resizable: false }),+ TightTaskList,+ TaskItem.configure({ nested: true }),SlashCommand.configure({codeBlockLabel: t('codeBlock'),+ taskListLabel: t('todoList'),tableLabel: t('table'),image: imageAttachments? { label: t('image'), onPick: () => setImagePickerOpen(true) }@@ -237,7 +242,7 @@ export default function MarkdownEditor({return (<div className={className}>- {editable && <EditorSelectionMenu editor={editor} />}+ {editable && <EditorSelectionMenu editor={editor} taskList />}{editable && <EditorTableMenu editor={editor} />}{/* Grows with the text rather than being pinned to the container's height,so a container that scrolls measures the overflow and shows a bar. */}diff --git a/apps/web/src/components/common/editor/tiptap-task-list.ts b/apps/web/src/components/common/editor/tiptap-task-list.tsnew file mode 100644index 00000000..673e26a7--- /dev/null+++ b/apps/web/src/components/common/editor/tiptap-task-list.ts@@ -0,0 +1,21 @@+import TaskList from '@tiptap/extension-task-list';++// tiptap-markdown treats bullet and ordered lists as tight, but not task lists,+// so every task item would serialize with a blank line after it. Keep task lists+// tight as well, so `- [ ]` lines come back unchanged.+export const TightTaskList = TaskList.extend({+ addGlobalAttributes() {+ return [+ {+ types: [this.name],+ attributes: {+ tight: {+ default: true,+ parseHTML: () => true,+ renderHTML: () => ({}),+ },+ },+ },+ ];+ },+});diff --git a/apps/web/src/lib/tiptap-slash-command.test.ts b/apps/web/src/lib/tiptap-slash-command.test.tsindex 96218163..853b0348 100644--- a/apps/web/src/lib/tiptap-slash-command.test.ts+++ b/apps/web/src/lib/tiptap-slash-command.test.ts@@ -45,4 +45,12 @@ describe('buildSlashItems', () => {],);});++ it('offers a task list in a compact editor that registers the extension', () => {+ const items = buildSlashItems({ codeBlockLabel: 'Code', taskListLabel: 'Tasks' });+ assert.deepEqual(+ items.map((item) => item.title),+ ['Tasks', 'Code'],+ );+ });});diff --git a/apps/web/src/lib/tiptap-slash-command.ts b/apps/web/src/lib/tiptap-slash-command.tsindex b160b795..8e28ed96 100644--- a/apps/web/src/lib/tiptap-slash-command.ts+++ b/apps/web/src/lib/tiptap-slash-command.ts@@ -36,6 +36,9 @@ export type SlashCommandOptions = {tableLabel?: string;// Omitted where there is nothing to pick from, which drops the Image item.image?: { label: string; onPick: () => void };+ // For an editor that registers the task-list extensions but has no rich block+ // menu. An editor that passes `blocks` already has the item there.+ taskListLabel?: string;// Editors that expose a richer block schema opt into these commands. Keeping// this optional preserves the compact Issue and agent-instruction menus.blocks?: {@@ -94,6 +97,13 @@ export function buildSlashItems(options: SlashCommandOptions): SlashItem[] {},);}+ if (options.taskListLabel && !options.blocks) {+ items.push({+ title: options.taskListLabel,+ icon: CheckSquare2,+ run: ({ editor, range }) => editor.chain().focus().deleteRange(range).toggleTaskList().run(),+ });+ }items.push({title: options.codeBlockLabel,icon: SquareCode,