Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"permissions": {
"allow": [
"Bash(npm rebuild:*)",
"Bash(npx tsc:*)",
"Bash(npm test:*)"
]
}
}
2 changes: 1 addition & 1 deletion src/api/data/labNotesStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type ApiLabNote = {

published: string; // "" or YYYY-MM-DD
status: "draft" | "published" | "archived";
type: "labnote" | "paper" | "memo";
type: "labnote" | "paper" | "memo" | "lore" | "weather" | "tail";
locale: string;

department_id: string;
Expand Down
16 changes: 4 additions & 12 deletions src/mappers/labNotesMapper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// src/mappers/labNotesMapper.ts
import { marked } from "marked";
import type { LabNoteRecord } from "../types/labNotes.js";
import type { LabNoteRecord, LabNoteStatus, LabNoteType } from "../types/labNotes.js";
import { ALLOWED_NOTE_TYPES } from "../types/labNotes.js";

/* ===========================================================
🧭 Lab Notes Mapper — Ledger-First Output
Expand All @@ -16,17 +17,6 @@ import type { LabNoteRecord } from "../types/labNotes.js";
- Auth decisions
=========================================================== */

type LabNoteStatus = "published" | "draft" | "archived";
type LabNoteType = "labnote" | "paper" | "memo" | "lore" | "weather";

const ALLOWED_NOTE_TYPES: ReadonlySet<LabNoteType> = new Set([
"labnote",
"paper",
"memo",
"lore",
"weather",
]);

marked.setOptions({
gfm: true,
breaks: false, // ✅ strict
Expand Down Expand Up @@ -65,6 +55,7 @@ function deriveType(note: LabNoteRecord): LabNoteType {
if (note.category === "memo") return "memo";
if (note.category === "lore") return "lore";
if (note.category === "weather") return "weather";
if (note.category === "tail") return "tail";

return "labnote";
}
Expand Down Expand Up @@ -188,3 +179,4 @@ export function mapToLabNotePreview(note: LabNoteRecord, tags: string[]) {
card_style: note.card_style ?? undefined,
};
}

2 changes: 1 addition & 1 deletion src/types/UpsertBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type UpsertBody = {
summary?: string; // longer abstract (UI-facing)

// taxonomy
type?: "labnote" | "paper" | "memo" | "lore";
type?: "labnote" | "paper" | "memo" | "lore" | "weather" | "tail";
status?: "draft" | "published";
category?: string; // legacy / optional
dept?: string; // human-facing dept label
Expand Down
3 changes: 2 additions & 1 deletion src/types/labNotes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// src/types/labNotes.ts

export type LabNoteType = "labnote" | "paper" | "memo" | "lore" | "weather";
export type LabNoteType = "labnote" | "paper" | "memo" | "lore" | "weather" | "tail";
export type LabNoteStatus = "published" | "draft" | "archived";

export const ALLOWED_NOTE_TYPES: ReadonlySet<LabNoteType> = new Set([
Expand All @@ -9,6 +9,7 @@ export const ALLOWED_NOTE_TYPES: ReadonlySet<LabNoteType> = new Set([
"memo",
"lore",
"weather",
"tail",
]);

export interface LabNoteRecord {
Expand Down
Loading