demos did not convey needed feedback
BIN
demos/1b3aa9ee-2026-05-15.png
Normal file
|
After Width: | Height: | Size: 232 KiB |
BIN
demos/28c17b37-2026-05-15.png
Normal file
|
After Width: | Height: | Size: 230 KiB |
55
demos/demo-20260515-111539-source-viewer-fix.md
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
# Demo: Source Viewer Fix
|
||||||
|
|
||||||
|
*2026-05-15T10:15:39Z by Showboat dev*
|
||||||
|
<!-- showboat-id: 50614918-1e97-44de-9247-3f39ca35af4a -->
|
||||||
|
|
||||||
|
## Bug Fix: Source Viewer Showing Wrong File
|
||||||
|
|
||||||
|
**Issue**: The source viewer in the Microprints page always showed 'defmodule Blogex' regardless of which file's Expand button was clicked.
|
||||||
|
|
||||||
|
**Root Cause**: In `resolve_absolute_paths/1`, app files (e.g., `lib/firehose.ex`) were resolved using `Path.expand(path)` which expands relative to the current working directory instead of relative to the `app_root`. This caused app files to resolve to wrong paths.
|
||||||
|
|
||||||
|
**Fix**: Changed `resolve_absolute_paths/1` to use `Path.join(app_root, path)` for all paths, ensuring both app files and `../blogex/...` files resolve correctly relative to the app directory.
|
||||||
|
|
||||||
|
## Test Suite
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd app && mix test test/firehose_web/live/microprints_live_test.exs --color
|
||||||
|
```
|
||||||
|
|
||||||
|
```output
|
||||||
|
Running ExUnit with seed: 924777, max_cases: 32
|
||||||
|
|
||||||
|
[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m[32m.[0m
|
||||||
|
Finished in 0.9 seconds (0.9s async, 0.00s sync)
|
||||||
|
[32m8 tests, 0 failures[0m
|
||||||
|
```
|
||||||
|
|
||||||
|
All 8 tests pass, confirming that `scan_source_files/0` returns correct paths for both app and blogex files.
|
||||||
|
|
||||||
|
## UI Verification
|
||||||
|
|
||||||
|
```bash {image}
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```bash {image}
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```bash {image}
|
||||||
|

|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Acceptance Criteria Verification
|
||||||
|
|
||||||
|
- [x] Source viewer displays actual source code of the specific file -- see UI Verification screenshots above
|
||||||
|
- [x] App files (e.g., `lib/firehose.ex`) show correct content -- see source-viewer-firehose.png
|
||||||
|
- [x] Router files (e.g., `lib/firehose_web/router.ex`) show correct content -- see source-viewer-router.png
|
||||||
|
- [x] All 8 tests pass
|
||||||
BIN
demos/f5e7eb02-2026-05-15.png
Normal file
|
After Width: | Height: | Size: 212 KiB |
BIN
demos/screenshots/microprints-2files.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
demos/screenshots/microprints-debug.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
demos/screenshots/microprints-page.png
Normal file
|
After Width: | Height: | Size: 212 KiB |
BIN
demos/screenshots/microprints-verify.png
Normal file
|
After Width: | Height: | Size: 212 KiB |
BIN
demos/screenshots/source-viewer-firehose-fixed.png
Normal file
|
After Width: | Height: | Size: 230 KiB |
BIN
demos/screenshots/source-viewer-firehose.png
Normal file
|
After Width: | Height: | Size: 230 KiB |
BIN
demos/screenshots/source-viewer-router.png
Normal file
|
After Width: | Height: | Size: 232 KiB |