feat(processes): monospace prompt editor for note_type=process
Task 6 of #582. NoteType gains 'process'. NoteEditorView branches to a plain monospace textarea (labeled Prompt) for processes instead of the TipTap rich-text editor — prompts are plain markdown and rich-text round-tripping would mangle them. Title/tags/save path unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
export type TaskStatus = "todo" | "in_progress" | "done" | "cancelled";
|
||||
export type TaskPriority = "none" | "low" | "medium" | "high";
|
||||
export type NoteType = "note" | "person" | "place" | "list";
|
||||
export type NoteType = "note" | "person" | "place" | "list" | "process";
|
||||
|
||||
export interface Note {
|
||||
id: number;
|
||||
|
||||
@@ -130,6 +130,7 @@ const titlePlaceholder = computed(() => {
|
||||
case 'person': return 'Name';
|
||||
case 'place': return 'Place name';
|
||||
case 'list': return 'List title';
|
||||
case 'process': return 'Process name';
|
||||
default: return 'Title';
|
||||
}
|
||||
});
|
||||
@@ -602,6 +603,18 @@ onUnmounted(() => assist.clearSelection());
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- ── Process (prompt) editor ──────────────────────────── -->
|
||||
<template v-else-if="noteType === 'process'">
|
||||
<label class="ef-label">Prompt</label>
|
||||
<textarea
|
||||
class="prompt-editor"
|
||||
:value="body"
|
||||
@input="onBodyUpdate(($event.target as HTMLTextAreaElement).value)"
|
||||
placeholder="The prompt to run when this process is fired (markdown). If it needs inputs, instruct Claude to ask up front."
|
||||
spellcheck="false"
|
||||
></textarea>
|
||||
</template>
|
||||
|
||||
<!-- ── Generic note editor ──────────────────────────────── -->
|
||||
<template v-else>
|
||||
<div class="body-tabs-row">
|
||||
@@ -1038,6 +1051,26 @@ onUnmounted(() => assist.clearSelection());
|
||||
font-size: 0.92rem;
|
||||
color: var(--color-primary);
|
||||
}
|
||||
.prompt-editor {
|
||||
width: 100%;
|
||||
min-height: 60vh;
|
||||
margin-top: 8px;
|
||||
padding: 14px 16px;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 8px;
|
||||
background: var(--color-surface);
|
||||
color: var(--color-text);
|
||||
/* Prompts are plain markdown — a code-style editor, not rich text. */
|
||||
font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
||||
font-size: 0.88rem;
|
||||
line-height: 1.55;
|
||||
tab-size: 2;
|
||||
resize: vertical;
|
||||
outline: none;
|
||||
}
|
||||
.prompt-editor:focus {
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
.ef-input {
|
||||
padding: 8px 12px;
|
||||
border: 1px solid var(--color-border);
|
||||
|
||||
Reference in New Issue
Block a user