9 Commits

Author SHA1 Message Date
Firehose Bot
790d2f0e1d Remember microprint state on reload 2026-05-18 20:17:38 +01:00
Firehose Bot
7c06204ac2 fix(microprints): fix source viewer showing stale content when switching files
The source_viewer component used static DOM IDs (id='source-viewer')
with phx-update='ignore'. When switching expanded files, LiveView
reused the same DOM element but phx-update='ignore' prevented content
from being updated, showing the previous file's source.

- Override source_viewer/1 in MicroprintsLive with unique per-file IDs
  generated via :erlang.phash2(file_path)
- Add test verifying expand-switch shows correct source content
- Add test for highlight/expand coupling (collapse when highlighting
  a different file)
- All 160 tests pass
2026-05-18 18:04:47 +01:00
Firehose Bot
36bdc0610e fix(microprints): collapse expanded file when highlighting a different file
- Add test in microprints_live_test.exs that documents the uncoupled state bug
- Fix handle_event("highlight_line") to collapse expanded_path when
  highlighting a line in a different file
- All 159 tests pass
2026-05-18 17:28:30 +01:00
eec0ff67b3 fix(microprints): pass unique id to source_viewer to fix DOM state
- source_viewer now receives id="source-viewer-#{path}" for unique DOM ids
- Fixes stale content bug when switching between expanded files
2026-05-15 16:21:11 +01:00
43aaa6bdbe fix(microprints): always show microprint SVG, source below when expanded
Layout: button → microprint (always) → source viewer (conditional)
2026-05-15 16:21:11 +01:00
aaf4c6a2c7 refactor(microprints): move expand/collapse button above microprint
- Button is now on top of the card, matching qwan-tracker layout
- Microprint SVG shown when collapsed, source viewer when expanded
- Fixes DOM confusion from duplicate source-viewer IDs by only
  rendering one source_viewer at a time
2026-05-15 16:21:11 +01:00
3434042aed fix(microprints): resolve absolute paths correctly for source viewer
- Use Path.expand(Path.join(app_root, path)) to correctly resolve both
  app files (lib/...) and blogex files (../blogex/...)
- Previously Path.join alone did not resolve '..' components, causing
  all source viewers to show the wrong file content
2026-05-15 16:21:11 +01:00
f01cdf918a fix(microprints): limit page to 2 most recently modified files
- Sort source files by mtime (newest first) and take only the first 2
- This limits the page scope for easier testing/investigation
- Temporary limit; will be 10 most recently changed files later
- Updated tests to work with the 2-file limit
2026-05-15 16:21:11 +01:00
7a50f2d4e7 WIP microprints source now showing
also added go to install showboat and rodney for the next steps.

microprints work in qwan tracker, but not in firehose. some of the
rendering is in the project, maybe the library should provide sample
webpages.
2026-05-14 11:15:37 +01:00