Skip to content

feat(grid): default filter setting, tighter header, drop refresh button (0.5.0) - #16

Merged
CR0CKER merged 1 commit into
masterfrom
feat/default-filter-spacing
Sep 10, 2026
Merged

CR0CKER merged 1 commit into
masterfrom
feat/default-filter-spacing

Conversation

@CR0CKER

@CR0CKER CR0CKER commented Sep 10, 2026

Copy link
Copy Markdown
Owner

What changed

  • New setting: Default Reading List filter (All / To Read / Reading / Read / Favorites). It picks the chip that's active each time the Reading List page opens. A filter argument on the renderer macro ({{renderer :reading-list, reading}}) still takes precedence. The resolver is a pure function in src/filters.ts, with tests in tests/filters.test.ts.
  • Title → chips gap fixed. The grid inherited Logseq's block-content white-space: pre-wrap, so the newlines and indentation in our HTML template rendered as two blank 21px text lines above the chip bar. .lrl-readinglist now sets white-space: normal, and the bar's 4px top margin is gone. The chips now sit where the first bullet sits on a normal page.
  • Removed the ↻ refresh button. Reading List: refresh grid stays in the command palette.
  • Security: bumped the dompurify override from 3.4.12 to 3.4.14 for GHSA-55q2-fjhq-7xh7 (moderate XSS; fixed in 3.4.13). Without it the npm audit --omit=dev gate fails.
  • README and CHANGELOG updated; CHANGELOG cut as 0.5.0.

Why it changed

  • Users want the grid to open on their preferred view.
  • The header gap was visibly larger than on normal pages.
  • The refresh button wasn't needed in the normal flow. The grid mounts and re-queries every time the page opens, and adding a book redirects to the new page.

Testing instructions

  • npm test (54 passing, 10 new), npm run typecheck, npm run build, npm audit --omit=dev (0 vulnerabilities).
  • Manually verified by loading the unpacked build in Logseq:
    • The setting appears, and the grid opens on the chosen filter.
    • The chips line up with where a normal page's first bullet sits.
    • No ↻ button appears.
  • Root cause of the gap measured from the live DOM (42px between .lrl-readinglist and .lrl-bar). Reproduced in headless Chromium under pre-wrap (42px) and confirmed at 0px with the fix.

Self-review

Checked correctness and edge cases: unknown or non-string setting values fall back to all; macro args are case- and space-insensitive; rlRefresh is kept for the command palette. For XSS, resolveInitialFilter only ever returns values from a fixed list, so nothing user-controlled reaches the markup. Blast radius: the white-space change is scoped to .lrl-readinglist.

Known (not shipped): dev-only advisories in the Parcel/Vitest toolchain. They're noted in the changelog under Known issues and will get a follow-up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TT8Y9w6w2kLuBgcUWqVJpc

…on; 0.5.0

- Add a "Default Reading List filter" setting (All / To Read / Reading /
  Read / Favorites). The grid opens on it every time the page opens; a
  filter argument on the renderer macro still wins. Pure resolver in
  src/filters.ts with unit tests.
- Fix the gap between the page title and the filter chips: the grid
  inherited Logseq's block-content white-space:pre-wrap, which rendered
  the template's newlines/indentation as two blank 21px lines. Set
  white-space:normal on the grid; drop the bar's 4px top margin.
- Remove the refresh button. The query re-runs on every page open;
  "Reading List: refresh grid" stays in the command palette.
- Bump the dompurify override 3.4.12 -> 3.4.14 (GHSA-55q2-fjhq-7xh7),
  which the npm-audit CI gate would otherwise fail on.
- README and CHANGELOG updated; CHANGELOG cut as 0.5.0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TT8Y9w6w2kLuBgcUWqVJpc
@CR0CKER
CR0CKER merged commit 86d7931 into master Sep 10, 2026
5 checks passed
@CR0CKER
CR0CKER deleted the feat/default-filter-spacing branch September 10, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant