- I1: trashCount 가 upsertNote 안에서 항상 trashNotes.length 로 덮어써져
server 값 (refreshMeta) 손상. showTrash=true (trashNotes cache-loaded)
일 때만 local recompute.
- I2: restoreNote 의 "fallback for missed event" 주석 부정확 — main 은
trash/restore 시 pushNoteUpdated 안 보냄. 자가 갱신이 primary mechanism.
주석 정정.
- M5: restoreNote 테스트가 IPC 호출만 검증, 노트 이동 미검증. trashNotes
→ notes 라우팅 + deletedAt=null 어설션 추가. + I1 회귀 가드 테스트 신규.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
F4-C·F (cue 강화) — Inkling 의 두 표면에 정체성 신호를 추가.
F4-C 환경 앵커 (tray):
- nativeImage 색 변경은 미지원이므로 색 뱃지 대신 tooltip + 메뉴 첫
비활성 라벨로 대체. tooltip 은 항상 `Inkling — 오늘 N`,
메뉴 첫 항목은 N>0 일 때 `오늘 N번 잡아둠` (비활성).
- `tray.ts` 가 `refreshTray(todayCount)` 를 export 하여 main 이
60s interval + AiWorker.onUpdate hook 에서 갱신을 트리거.
- N=0 일 때는 라벨을 띄우지 않아 메뉴가 자연스럽게 시작.
F4-F 정체성 고리 (Inbox 헤더):
- ContinuityBadge 옆에 새 IdentityCounter 컴포넌트.
- N>0 → `오늘 N번 잡아뒀다` (정체성 강화 카피).
- N=0 → `오늘은 처음 한 줄?` (priming 카피로 첫 캡처 유도).
- 갱신은 `loadInitial` / `refreshMeta` (focus + note:updated) 경로
공유 — 별도 IPC subscription 없음.
Wiring:
- `NoteRepository.countToday()` 를 `inbox:todayCount` IPC 로 노출.
- preload bridge `getTodayCount`, `InboxApi.getTodayCount()` 타입.
- 스토어에 `todayCount: number` 필드 추가, 두 메타 fetch 경로 모두에서 갱신.
스키마 변경 없음. 197/197 unit pass, 1/1 e2e pass.
Splits the tag chip into two actions per F2 dogfood feedback:
- short click on chip text → applies the tag to the inbox filter
(Inbox header shows "🔎 필터: #tag (n개)" banner with ✕ 해제 button)
- × button on chip → immediately removes the tag and surfaces a
module-level pub/sub undo toast for 5 seconds; clicking the toast
restores the tag
`TagUndoToast` is a tiny self-contained component: `pushTagUndo()` from
NoteCard publishes an entry, the mounted `<TagUndoToast />` near the
end of `<App>` subscribes and renders it. Auto-dismiss after 5 s,
click-to-undo cancels the timer and runs the restore callback.
AI vs user tags share the same behaviour — only the chip background
colour distinguishes them, matching the F2 decision table.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds `tagFilter: string | null` and `setTagFilter` to the inbox store, plus
an extracted pure `selectFilteredNotes` selector so unit tests can import it
under vitest's `node` environment without dragging `api.ts` (which touches
`window.inkling` at module load).
Tests cover four cases: null filter passes through, single-tag match,
no-match empty result, and any-tag-matches semantics.
F2 dogfood feedback step 1/3.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Inline 📅 YYYY-MM-DD badge appears in NoteCard between summary and
tags. Click to edit (HTML date input). Past dates: gray + line-through.
AI label shown when not user-edited (mirrors title/summary AI badge
policy). Empty state shows '📅 마감일 추가' link in gray.
New IPC inbox:setDueDate routes to NoteRepository.setDueDate which
sets due_date_edited_by_user=1 (per slice §1.1 invariant 2 — user
edit blocks future AI overwrite). Preload bridge + InboxApi type
extended.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When the OllamaBanner appears, it was generic enough that the user
couldn't tell whether the env var was missing, the LAN host was
unreachable, the model was uninstalled, or DNS was failing. Log the
resolved endpoint at startup with a `fromEnv` flag so we can confirm
INKLING_OLLAMA_ENDPOINT was actually read, and render the underlying
health-check reason as a small subtitle under the banner copy.
The user-facing primary message still avoids the forbidden tone words
("실패"/"끊김"/"연속 실패"); the diagnostic line is technical and only
appears when status.reason is set.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two related runtime defects surfaced when first attempting
`npm run build` + Electron launch:
1. Renderer html files referenced `/src/.../main.tsx`, which
vite dev resolves but vite production rollup cannot. Changed
both inbox and quickcapture to `./main.tsx` (sibling-relative).
2. Electron 41's main-process module hook only injects the
real `electron` API into `require('electron')` calls inside
CommonJS modules. With package.json `"type": "module"` set,
electron-vite emitted ESM bundles that did
`import { app } from "electron"`; Node's ESM CJS-interop
then loaded the on-disk index.js (which exports the binary
path string) instead, leaving `app` undefined at startup.
Fix: drop `"type": "module"` so electron-vite emits CJS for
main + preload (renderer is unaffected — vite handles its own
ESM transform regardless). Source files keep modern import
syntax via the default-import + destructure pattern
(`import electron from 'electron'; const { app } = electron;`)
which transpiles correctly to `const { app } = require('electron')`
in the CJS output.
Also updated `electron-log/main` -> `electron-log/main.js`
because Node ESM strict resolution requires the `.js` extension
even though the package's CJS entry serves both.
Verification: `npm run build` produces 47-module renderer +
1005KB main bundle without errors. `npm run typecheck` clean.
Unit suite (52 tests) unaffected.
Plan deviation log: Task 4 (logger), Task 30 (main wiring), and
Tasks 17/18/22/30 referencing electron imports landed with named
imports per plan; this commit refactors them to default+destructure
without changing semantics.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task 29 of the slice plan. Subscribes to ollamaStatus from the
inbox store and renders one of two messages: 'ollama pull
gemma4:e4b 실행 후 앱을 재시작해주세요.' when the model isn't
installed (status.reason includes 'not installed'), or
'Inkling 정리가 잠시 멈췄습니다. Ollama를 실행해주세요.' for
any other unhealthy state. Capture continues regardless.
HealthChecker.ts itself was pulled forward in Task 21 so its
import would resolve from inboxApi.ts at compile time.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task 28 of the slice plan. Renders the green '🌱 흐름을 다시
이어갑니다' banner only when the parent says show=true
(continuity.showRecoveryToast && !dismissedToday). Click ✕
calls onDismiss which persists today's date in localStorage
via recoveryToast.ts, suppressing it for the rest of the KST
day even after a reload.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task 27 of the slice plan. Surfaces 'meaning question' once
per note (gated by intent_prompted_at IS NULL on the backend
side; frontend just provides the input UX). intentPrompts.ts
holds the 4 rotating prompts plus a deterministic
pickIntentPrompt(noteId) (FNV-style 32-bit hash mod 4) so the
same note always gets the same question across reloads. Submit
calls setIntent and reports the typed text up; Skip calls
dismissIntent and reports null. 200-char cap matches repo-side
truncation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task 26 of the slice plan. Click-to-edit primitive used for
title, summary, and intent. Blur commits via injected onSave;
Enter blurs (single-line); Escape cancels and reverts to
the prop value. Failed save shows a 1px red outline for 800ms
and restores the prior value (no error message — caller decides
visual feedback). singleLine prop swaps <input> for <textarea>.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task 25 of the slice plan. Single-card view of a note with
local optimistic state plus the IPC writes. Per-status branches:
- pending: 'Inkling이 정리하는 중…' headline, raw text auto-open.
- failed: '정리 보류 — 원문은 안전합니다' with hover tooltip.
- done: editable title + summary (each with the gray 'AI' badge
hidden as soon as *_edited_by_user flips), tag chips with
AI subscript, optional 💡 user_intent row, IntentBanner
surfaced exactly when intent_prompted_at is null.
Tag click removes (per spec), title/summary edits route through
inboxApi.updateAiFields (which sets the edited flag server-side),
intent edits use inboxApi.setIntent. Delete confirms with '이
기억을 버릴까요? 되돌릴 수 없습니다.' and routes through
CaptureService.deleteNote so media gets cleaned up.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task 24 of the slice plan. Subscribes to pendingCount in the
store and renders '🟡 Inkling이 정리하는 중: N건' when count > 0.
Hidden when zero so the layout doesn't reserve space.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task 23 of the slice plan. Reads continuity from the zustand
store and renders one of three states: '이번 주 한 줄이면
시작입니다' (0 notes), '이번 주 N/7' (in-progress), or
'이번 주 7/7 ✓ · 연속 K주 완성' (target hit, with K only when
> 0). No '실패'/'끊김' wording.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task 22 of the slice plan. Wires the Inbox window's renderer:
- index.html (replaces the placeholder shipped in Task 2) with
the full layout styles + module script.
- api.ts re-exports window.inkling.inbox as a typed InboxApi.
- recoveryToast.ts persists per-day toast dismissal in
localStorage (KST date key) so the banner never re-fires
after the user closes it.
- store.ts: zustand store with notes, continuity, pendingCount,
ollamaStatus, loadInitial(), refreshMeta(), upsert/remove.
- main.tsx mounts <App />.
- App.tsx orchestrates loadInitial + onNoteUpdated subscription
+ window-focus refresh, renders header / banners / note list.
- 7 component stubs (NoteCard / EditableField / IntentBanner /
RecoveryToast / ContinuityBadge / PendingBanner / OllamaBanner)
so the shell typechecks today; Tasks 23-28 swap each in.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task 19 of the slice plan. Frameless dark card with:
- placeholder "지금 머릿속에 있는 것 한 줄. 정리는 나중입니다."
- hint "Ctrl+Enter 구출 · Esc 취소 · 이미지 붙여넣기"
- Ctrl/Cmd+Enter to submit (window.inkling.capture.submit then
hide), Esc to cancel (with "이 한 줄을 흘려보낼까요?" confirm
when text > 5 chars)
- clipboard image paste -> thumbnail strip with ArrayBuffer
retained for submit
- fallback "저장에 실패했습니다. 다시 시도해주세요." in-card on
IPC error (window stays open with content preserved)
api.ts wraps window.inkling.capture as the typed CaptureApi.
main.tsx mounts <App /> on #root.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Task 2 of the slice plan. Creates the minimal Electron main
process: app entry that opens an Inbox BrowserWindow on
whenReady, an inboxWindow module that handles show/hide/close-
to-tray semantics, an HTML placeholder renderer ("Inkling Inbox
(renderer pending)"), and the minimum @shared/types augmentation
for app.isQuitting (Task 3 expands this file).
Plan tsconfig template adjustment: TypeScript 6 deprecates
baseUrl. Dropped it and made paths entries explicitly relative
("./src/...") so they resolve from tsconfig.json's directory.
Updated both the in-repo tsconfig.json and Task 1 Step 3 in the
plan to match.
Verification: `npm run typecheck` exits 0. Full `npm run dev`
sanity check is deferred until Task 3 (preload) and Task 19
(quickcapture HTML) land — electron-vite.config.ts wires both
entries that don't yet exist.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>