diff --git a/src/server/routes/note.ts b/src/server/routes/note.ts index 0415cc5..8cd597c 100644 --- a/src/server/routes/note.ts +++ b/src/server/routes/note.ts @@ -12,7 +12,13 @@ import { parseNoteFormFields, } from "../../lib/orchestrators/note.ts"; import { htmlResponse } from "../../lib/response.ts"; -import { collabWsPath, noteUrl, redirect, wikiUrl } from "../../lib/urls.ts"; +import { + collabWsPath, + editNoteUrl, + noteUrl, + redirect, + wikiUrl, +} from "../../lib/urls.ts"; import { editNotePage } from "../../views/edit-note.ts"; import { HISTORY_PAGE_SIZE, @@ -59,7 +65,9 @@ export const noteRoutes = new Elysia() try { const { noteSlug } = await createNoteAction(ctx, fields, msg); - return redirect(noteUrl(ctx.ownerHandle, ctx.wiki.slug, noteSlug)); + // Drop the author straight into the live collaborative editor: the note + // now exists on the wiki, and its body is written there, not here. + return redirect(editNoteUrl(ctx.ownerHandle, ctx.wiki.slug, noteSlug)); } catch (err) { if (err instanceof ValidationError) { return htmlResponse( diff --git a/src/views/new-note.ts b/src/views/new-note.ts index 96b3d1d..cc388dc 100644 --- a/src/views/new-note.ts +++ b/src/views/new-note.ts @@ -29,28 +29,17 @@ export function newNotePage( const titleValue = escapeHtml(options?.titleValue ?? ""); const escapedContent = escapeHtml(options?.contentValue ?? ""); - // Editor/preview sizing is owned by editor.ts (shared with the edit page), so - // there's no page-local height hack here anymore. + // Creation captures only a title (optionally pre-filled by importing a file). + // The body is authored afterwards in the collaborative editor, so the content + // field here is hidden — it exists solely to carry imported file text to the + // server. initFileImport() in editor.ts fills it; initEditor() skips it because + // it is display:none, so no solo CodeMirror is mounted on this page. return layout( `${msg.wiki.newNote} — ${wiki.name}`, `