Commit Graph

10 Commits

Author SHA1 Message Date
jules
efc2c18a91 fix(kb-ui): make the object reader readable — reflow, window, jump-to
The reader dumped the whole server slice verbatim: a ~445k-char doc rendered
as a 16,558px wall of one-source-line-per-line ragged text, and the outline
panel showed 8 blank rows (the API's sections carry heading:null — they're
mechanical 60k-char chunks, not headings).

- Reflow: off the citation path, parse the extracted markdown/PDF text into
  real blocks — drop form-feeds, split on blank lines, join soft-wrapped
  lines into paragraphs, lift markdown headings + multi-line bullet lists.
  Cap prose width at 68ch. The citation-highlight path still renders the raw
  slice verbatim so character offsets stay exact.
- Window every load: initial 8k chars, "Read more" +12k, section jump loads a
  bounded window from the section's start (server honours start/end precisely).
  Object height 16,558 → ~5,315px; Read more/citations verified.
- Outline: blank heading:null rows now render as "Part N" jump points and the
  panel is titled "Jump to" (vs "Outline") when there are no real headings;
  aria-current on the active row.

Verified live on dev-knowledge.sky-ai.com.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 08:51:50 +10:00
jules
ac7c294753 fix(kb-ui): P0 provenance crash + AA badges + a11y + first-run polish
Provenance/claims carried created_by/verified_by as {type,id} principal
refs from the service, but the types said string|null and ProvenancePanel
rendered them raw → React #31 crash on every object view. Widen to
string|PrincipalRef|null and add formatPrincipal() (barrel-exported).

Badges: mode-aware semantic tones (mix toward --foreground) so success/
warning/info/danger text clears WCAG AA on the subtle tint in BOTH light
and dark; Active badge 2.81→5.25/5.67:1. SensitivityBadge renders nothing
for an unset level (objects inherit from their collection) instead of a
misleading "—" pill. TierBadge tolerates an unknown tier.

Accessibility: Badge gains ariaLabel (screen readers announce the meaning,
not just the terse label); Field links label↔control via htmlFor + useId
and wires aria-describedby to the hint; OwnerToggle gets aria-pressed;
icons aria-hidden.

First-run: CollectionForm leads with Name and auto-derives the Identifier
(was slug-first); placeholder text uses --muted-foreground. Drop the
Sparkles "AI-magic" icons from the review empty state and the agent tier
badge (Inbox / Bot instead), per the no-magic-framing principle.

Verified live on dev-knowledge.sky-ai.com.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 08:40:24 +10:00
jules
2c921a911c feat(kb-ui): MemoryReviewQueue — free-text note curation (spec §9)
The curation base for a per-person gated `memory` collection of FREE-TEXT notes
(kind: note), distinct from ClaimsReviewQueue's subject·predicate·value triples.
Groups proposed (specialist-noted, awaiting confirmation) vs remembered (active),
with confirm/forget callbacks, source attribution, and tags — matching the KB UI
house style. Collection-agnostic (props in, callbacks out): the same base powers
the KB `memory` collection and a consumer's /memory page.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 10:10:18 +10:00
jules
03443590a2 fix(kb-ui): SensitivityBadge tolerates an unset/unknown level
A kb.list row can arrive without a sensitivity (a claim/note, or older data);
SENSITIVITY[level] was then undefined and reading .tone crashed the whole
object list. Fall back to a neutral badge — never defaulting an unknown value
to "Open", which would misstate exposure. (Surfaced building the standalone
webapp against a real corpus.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 13:38:22 +10:00
jules
c3dc237aa4 feat(kb-ui): lift search + collection load-more into the lib
Both consumers (embedded + the coming standalone) need the same search UI and
paginated lists; keep them from diverging by owning both here.

- KnowledgeSearch (components-search.tsx): the search input + paginated results
  panel, over an injected onSearch. Owns query/results/loading/error/clear and a
  "Load more" for search results; renders the caller's `browse` content when
  there is no active search. Replaces each app hand-rolling hit rendering.
- CollectionList: onLoadMore/hasMore/loadingMore (mirrors ObjectList), so a
  paginated corpus list gets a load-more affordance.

Stacked on fix/kb-ui-p0 (ObjectList already gained load-more there). tsc clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 12:05:07 +10:00
jules
66221afedc fix(kb-ui): P0 correctness — TextReader race/errors, outline nav, claims drop, object load-more
- TextReader: monotonic request guard (stale slice can't clobber current) +
  catch with a retry surface instead of a blank panel / unhandled rejection;
  Read-more guarded and shows loading.
- OutlineNav: an explicit section selection now wins over the initial citation
  highlight, so clicking sections works on ?start=&end= views (was inert).
- ObjectViewer: reset section + image on object switch (no bleed across
  citation navigation); catch the blob resolve.
- ObjectList: optional onLoadMore/hasMore/loadingMore (paginated corpuses).
- ClaimsReviewQueue: catch-all "Awaiting review" bucket so a claim the queue
  returned is never silently dropped (e.g. an open-conflict singleton whose
  counterpart is not in the payload).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 21:03:36 +10:00
jules
efbf4b2e61 W6: export panel
components-export: ExportPanel (scope picker + request) + ExportJobRow (status,
download on ready, error verbatim; timer lives in the app per the polling
contract). Demo Export tab polls getExport app-side. Lib confirmed
self-contained (react + lucide only); README/tsconfig updated. Typechecks clean.

Co-Authored-By: Claude Fable 5 (build) <noreply@anthropic.com>
2026-07-07 10:05:46 +10:00
jules
40d2f94795 W5: claims review queue
components-claims: ClaimsReviewQueue (proposed → conflicts → unreviewed per
claims-spec §2.3), ClaimCard (confirm/reject/reopen tombstone), ConflictPair
(both sides raw, three resolutions: keep-with-supersede, dismiss-both,
reject-newcomer; human_confirmed can't be rejected). Tiers raw, no scores.
Demo Review tab wired. Typechecks clean.

Co-Authored-By: Claude Fable 5 (build) <noreply@anthropic.com>
2026-07-07 10:03:54 +10:00
jules
9dd162d815 W4: object viewer
components-object: ObjectList, ObjectViewer (CatalogCard + ProvenancePanel +
SupersessionBanner + OutlineNav + TextReader with citation highlight/scroll +
load-more, image render, vault notice, action bar), CitationLink + parseCite.
Demo browses collections → objects → viewer. Typechecks clean.

Co-Authored-By: Claude Fable 5 (build) <noreply@anthropic.com>
2026-07-07 10:01:33 +10:00
jules
d2829d6348 W3: lib-knowledge-ui scaffold + collections
@crema/knowledge-ui: headless KB management components over an injected
KnowledgeTransport. This commit: package + types (full API surface) +
transport interface + MockKnowledgeTransport (fixtures for every surface) +
_internal (cn, badges, formatters) + components-collections (CollectionList
grouped by owner, CollectionCard, CollectionForm with org/read-only states) +
demo + README + tsconfig.check.json. Typechecks clean.

Co-Authored-By: Claude Fable 5 (build) <noreply@anthropic.com>
2026-07-07 09:57:46 +10:00