fix(web): strip OKF frontmatter from note body; colour graph by type#145
Merged
Conversation
…by type Two follow-ups to the 3.8.0 OKF work, in the server's web UI + graph: Fixed — the note view ran `marked` over the raw note, so 3.8.0's new leading `---` frontmatter block rendered as a horizontal rule + the frontmatter keys as stray text atop every note. `renderMarkdown` now strips the leading frontmatter block before rendering (it's already surfaced in the structured header). No Python test caught this — it's pure client-side rendering — so verified with node. Changed — the knowledge graph now colours nodes by OKF `type` instead of by degree (node SIZE still encodes degree), with a legend built from the types present. graph.py: GraphNode carries `okf_type` (derived the same way render does), `to_json` emits a `type` per node (so /api/graph + `graph export --json` carry it), and `to_dot` fills nodes by type. graph.js: type→colour map + type legend. ruff + mypy clean; full suite 742 passed (+3 graph tests). JS syntax-checked with `node --check`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JFuGddPx3UhUkcC74KBXZB
CryptoJones
added a commit
that referenced
this pull request
Jul 2, 2026
Web UI + graph follow-ups to the 3.8.0 OKF work (#145): strip the OKF frontmatter from the rendered note body (it was showing as an <hr> + keys after 3.8.0), and colour the knowledge graph by OKF `type` (node size still encodes degree). Version 3.8.0 -> 3.8.1 (pyproject + __init__ + uv.lock); CHANGELOG. Patch: a regression fix plus a change to existing graph colouring. ruff + mypy clean; 742 passed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JFuGddPx3UhUkcC74KBXZB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two follow-ups to the 3.8.0 OKF work, both in the server's web UI + graph — the "did you update the graph thinggy?" gaps.
Fixed — frontmatter showed as body text (regression from 3.8.0)
The note view rendered the body with
marked.parse(data.raw). After 3.8.0 gave every note a leading---YAML frontmatter block,markedrendered it as a horizontal rule + the frontmatter keys as stray text atop every note.renderMarkdownnow strips the leading frontmatter block first (it's already in the structured header). Client-side only, so no Python test caught it — verified withnode.Changed — graph coloured by OKF
typeThe knowledge graph (web view +
omind graph export) now colours nodes by their OKFtype, with a legend built from the types present. Node size still encodes link degree.graph.py:GraphNodecarriesokf_type(derived the same wayrender_fieldsdoes);to_jsonemits atypeper node (so/api/graphandgraph export --jsoncarry it);to_dotfills nodes by type.graph.js: type->colour map + type legend, replacing the degree-tier colouring.Verification
ruff+mypyclean; fullpytest742 passed (+3 graph tests: type carried into nodes / JSON / DOT)node --checkon both files; frontmatter-strip regex node-tested (strips frontmatter, preserves a later---hr in the body)Note: the checked-in
docs/graph.pngstill shows the old colouring — the DOT export is type-coloured now, so regenerating it picks up the new scheme.🤖 Generated with Claude Code
Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/