docs: document recent image-view refactor and new view context keys

This commit is contained in:
2026-03-23 20:30:23 -04:00
parent a97fb6078b
commit 9de61e9b46
2 changed files with 14 additions and 0 deletions

View File

@@ -84,6 +84,13 @@ Notes:
- `/gallery/` -> directory browsing and image view routing - `/gallery/` -> directory browsing and image view routing
- Preserve lazy thumbnail generation behavior unless task explicitly changes performance strategy. - Preserve lazy thumbnail generation behavior unless task explicitly changes performance strategy.
### Recent changes notes
- The image view was refactored to match the gallery layout and styling; `viewer/templates/image_view.html` now uses the shared `viewer/static/css/styles.css` file and Bootstrap/Font Awesome includes like `gallery_view.html`.
- `_render_image` in `viewer/views.py` now exposes additional context keys used by the template and tests: `prev_url`, `next_url`, `prev_thumb`, `next_thumb`, `back_url`, `back_thumb`, `home_url`, `home_thumb`, and `image_meta` (dictionary with `filename`, `width`, `height`, `filesize`, `created`, `modified`). Agents modifying image-view behavior should update tests in `viewer/test.py` as well.
- The top-bar sort button for the image view was replaced by an Info button (`fa-circle-info`) which shows a dropdown containing image metadata. The dropdown is vertically scrollable for long content.
- The displayed main image now uses the same drop shadow and rounded corners as thumbnails (styles added to `viewer/static/css/styles.css`).
## 7) Code Style Guidelines (Repository-Specific) ## 7) Code Style Guidelines (Repository-Specific)
### Imports ### Imports

View File

@@ -157,3 +157,10 @@ Default production location: `/var/lib/NibasaViewer`
- Fast extension-based detection (checks `IMAGE_EXTENSIONS` set) - Fast extension-based detection (checks `IMAGE_EXTENSIONS` set)
- Supports common formats: JPEG, PNG, GIF, WebP, BMP, TIFF, SVG - Supports common formats: JPEG, PNG, GIF, WebP, BMP, TIFF, SVG
- Accepts both `pathlib.Path` and string paths - Accepts both `pathlib.Path` and string paths
### Recent changes notes
- The image view was refactored to match the gallery layout and styling; `viewer/templates/image_view.html` now uses the shared `viewer/static/css/styles.css` file and Bootstrap/Font Awesome includes like `gallery_view.html`.
- `_render_image` in `viewer/views.py` now exposes additional context keys used by the template and tests: `prev_url`, `next_url`, `prev_thumb`, `next_thumb`, `back_url`, `back_thumb`, `home_url`, `home_thumb`, and `image_meta` (dictionary with `filename`, `width`, `height`, `filesize`, `created`, `modified`). Agents modifying image-view behavior should update tests in `viewer/test.py` as well.
- The top-bar sort button for the image view was replaced by an Info button (`fa-circle-info`) which shows a dropdown containing image metadata. The dropdown is vertically scrollable for long content.
- The main displayed image now uses the same drop shadow and rounded corners as thumbnails (styles added to `viewer/static/css/styles.css`).