Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

refactor: enhance Editor component layout and improve task description modal styling

Andrej Acevski586607a9611c
diff --git a/apps/web/src/components/common/editor.tsx b/apps/web/src/components/common/editor.tsx
index 9f1001fbe..a0ec8cdc2 100644
--- a/apps/web/src/components/common/editor.tsx
+++ b/apps/web/src/components/common/editor.tsx
@@ -175,8 +175,8 @@ export function Editor({
}
return (
- <div className="prose prose-zinc dark:prose-invert max-w-none [&_.is-editor-empty]:text-zinc-500 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mt-8 [&_h1]:mb-4 [&_h2]:text-xl [&_h2]:font-semibold [&_h2]:mt-6 [&_h2]:mb-3">
- <div className="flex flex-wrap gap-1 mb-4 p-2 -mx-1 border-b border-zinc-200 dark:border-zinc-800">
+ <div className="prose prose-zinc dark:prose-invert max-w-none [&_.is-editor-empty]:text-zinc-500 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mt-8 [&_h1]:mb-4 [&_h2]:text-xl [&_h2]:font-semibold [&_h2]:mt-6 [&_h2]:mb-3 flex flex-col h-full">
+ <div className="flex flex-wrap gap-1 p-3 border-b border-zinc-200 dark:border-zinc-800 flex-shrink-0 bg-zinc-800/30">
<div className="relative" ref={menuRef}>
<button
type="button"
@@ -339,10 +339,21 @@ export function Editor({
<Link2 className="w-4 h-4 text-zinc-600 dark:text-zinc-400" />
</button>
</div>
- <EditorContent
- editor={editor}
- className="flex-1 flex flex-col min-h-[200px] h-full [&_*]:focus:outline-none px-2"
- />
+ <div
+ className="flex-1 overflow-y-auto cursor-text"
+ onClick={() => editor.chain().focus().run()}
+ onKeyDown={(e) => {
+ if (e.key === "Enter" && !e.shiftKey) {
+ e.preventDefault();
+ editor.chain().focus().enter().run();
+ }
+ }}
+ >
+ <EditorContent
+ editor={editor}
+ className="h-full [&_*]:focus:outline-none px-3 py-3 [&_.ProseMirror]:min-h-full [&_.ProseMirror]:cursor-text"
+ />
+ </div>
</div>
);
}
diff --git a/apps/web/src/components/shared/modals/create-task-modal.tsx b/apps/web/src/components/shared/modals/create-task-modal.tsx
index 27c2712eb..7c9608e9e 100644
--- a/apps/web/src/components/shared/modals/create-task-modal.tsx
+++ b/apps/web/src/components/shared/modals/create-task-modal.tsx
@@ -308,7 +308,7 @@ function CreateTaskModal({ open, onClose, status }: CreateTaskModalProps) {
</div>
<div>
- <div className="border border-zinc-700/30 bg-zinc-800/30 min-h-[80px] rounded-lg py-0 px-3 shadow-sm backdrop-blur-sm">
+ <div className="border border-zinc-700/30 bg-zinc-800/30 h-[240px] rounded-lg shadow-sm backdrop-blur-sm overflow-hidden">
<Editor
value={description}
onChange={setDescription}
diff --git a/apps/web/src/components/task/task-description.tsx b/apps/web/src/components/task/task-description.tsx
index 06fa6af2c..5e7d19b54 100644
--- a/apps/web/src/components/task/task-description.tsx
+++ b/apps/web/src/components/task/task-description.tsx
@@ -53,20 +53,22 @@ function TaskDescription({ setIsSaving }: TaskDescriptionProps) {
}, [form]);
return (
- <div className="bg-white dark:bg-zinc-900 rounded-xl shadow-sm border border-zinc-200/50 dark:border-zinc-800/50 pb-1 px-1">
- <Form {...form}>
- <FormField
- control={form.control}
- name="description"
- render={({ field }) => (
- <Editor
- value={field.value || ""}
- onChange={(value) => handleDescriptionChange(value)}
- placeholder="Use the toolbar to format your description..."
- />
- )}
- />
- </Form>
+ <div className="space-y-2">
+ <div className="bg-white dark:bg-zinc-900 rounded-lg border border-zinc-200 dark:border-zinc-800 overflow-hidden shadow-sm h-[300px]">
+ <Form {...form}>
+ <FormField
+ control={form.control}
+ name="description"
+ render={({ field }) => (
+ <Editor
+ value={field.value || ""}
+ onChange={(value) => handleDescriptionChange(value)}
+ placeholder="Add a description to help your team understand this task..."
+ />
+ )}
+ />
+ </Form>
+ </div>
</div>
);
}