fix(browser): repair live wiki sorting and graph alignment #10

Merged
clawlter merged 1 commit from fix/live-browser-alignment-and-date-sorts into main 2026-04-15 20:50:31 -04:00
Owner

Summary

  • normalize wiki frontmatter dates before sorting so real mounted pages do not crash the UI on Recently added
  • align the initial detail/graph selection with the currently visible fact/wiki lists instead of hidden raw-order records
  • make responsive client hooks hydrate from the same server defaults before applying matchMedia updates

Root cause

  • gray-matter parses bare YAML dates as Date objects; the wiki sorter expected strings and crashed on localeCompare when the live wiki used real created: dates
  • the browser initialized fact/wiki selection from raw insertion order (factStore.facts[0], first slug key), while the list panes render filtered/sorted records; the graph and detail panes could therefore point at hidden records like _meta/README.md, making the mobile graph appear empty even when the visible list item had relationships
  • the responsive hooks read matchMedia() during the initial client render, which differed from the server-rendered desktop defaults and could trigger mobile hydration mismatches

Testing

  • npm run lint
  • npm run typecheck
  • npm test
  • npm run build
  • live Playwright smoke against mounted SQLite/wiki data on port 3132:
    • Brain wiki → Sort wiki by → Recently added updates the visible order without crashing
    • mobile wiki browse/detail/graph flow now lands on a connected visible page and renders 31 visible edges with bright mobile styling and no page errors
## Summary - normalize wiki frontmatter dates before sorting so real mounted pages do not crash the UI on Recently added - align the initial detail/graph selection with the currently visible fact/wiki lists instead of hidden raw-order records - make responsive client hooks hydrate from the same server defaults before applying matchMedia updates ## Root cause - `gray-matter` parses bare YAML dates as `Date` objects; the wiki sorter expected strings and crashed on `localeCompare` when the live wiki used real `created:` dates - the browser initialized fact/wiki selection from raw insertion order (`factStore.facts[0]`, first slug key), while the list panes render filtered/sorted records; the graph and detail panes could therefore point at hidden records like `_meta/README.md`, making the mobile graph appear empty even when the visible list item had relationships - the responsive hooks read `matchMedia()` during the initial client render, which differed from the server-rendered desktop defaults and could trigger mobile hydration mismatches ## Testing - npm run lint - npm run typecheck - npm test - npm run build - live Playwright smoke against mounted SQLite/wiki data on port 3132: - Brain wiki → Sort wiki by → Recently added updates the visible order without crashing - mobile wiki browse/detail/graph flow now lands on a connected visible page and renders 31 visible edges with bright mobile styling and no page errors
fix(browser): align visible selection and normalize wiki dates
All checks were successful
Build and publish container image / Build Docker image and publish package tags (pull_request) Successful in 1m12s
CI / Validate lint, types, tests, and production build (pull_request) Successful in 1m57s
Build and publish container image / Build Docker image and publish package tags (push) Successful in 1m46s
CI / Validate lint, types, tests, and production build (push) Successful in 2m3s
4a57a16c4e
Author
Owner

Self-review:

  • Reproduced both failures against the live mounted data before changing code.
  • Confirmed the wiki sort crash came from Date-valued frontmatter, not the select control itself.
  • Confirmed the mobile graph problem was selection desynchronization: list/detail/graph could point at different records, including hidden zero-link pages like _meta/README.md.
  • Re-ran full validation (lint, typecheck, test, build) plus live Playwright smoke on the updated production build.
Self-review: - Reproduced both failures against the live mounted data before changing code. - Confirmed the wiki sort crash came from Date-valued frontmatter, not the select control itself. - Confirmed the mobile graph problem was selection desynchronization: list/detail/graph could point at different records, including hidden zero-link pages like `_meta/README.md`. - Re-ran full validation (`lint`, `typecheck`, `test`, `build`) plus live Playwright smoke on the updated production build.
clawlter deleted branch fix/live-browser-alignment-and-date-sorts 2026-04-15 20:50:31 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
clawlter/hermes-brain-web!10
No description provided.