feat(kc): History Viewer — revision timeline display #40

Closed
opened 2026-02-18 21:16:10 +00:00 by forbes · 0 comments
Owner

Summary

Implement the History Viewer — a read-only revision timeline that displays silo/history.json content, newest-first. Shows revision number, lifecycle status badge, author, timestamp, and commit comment for each revision.

Widget specification

┌──────────────────────────────────────────────────┐
│  Revision History                 [Refresh]      │
├──────────────────────────────────────────────────┤
│  Rev 3 · released · joseph · 2026-02-13 20:30   │
│  Added fillet to mounting holes                  │
│  ────────────────────────────────────────────    │
│  Rev 2 · draft · joseph · 2026-02-12 14:00      │
│  Initial geometry                                │
└──────────────────────────────────────────────────┘

Layout

  • QListView with a custom QStyledItemDelegate rendering revision cards
  • Each card: revision number, status badge (colored per lifecycle), author, timestamp, comment
  • Refresh button fetches full server history if connected and updates the local snapshot
  • Offline: displays local silo/history.json snapshot with "Offline — showing cached data" banner

Status badge styles (inline QSS)

BADGE_STYLES = {
    "draft":    "background: #45475a; color: #cdd6f4;",
    "review":   "background: #f9e2af; color: #11111b;",
    "released": "background: #a6e3a1; color: #11111b;",
    "obsolete": "background: #f38ba8; color: #11111b;",
}

Tree icon

silo-history.svg — clock, Catppuccin Lavender #b4befe (fallback empty string if not yet created)

Files to modify

File Change
src/Mod/Create/silo_viewers.py Add SiloHistoryViewer widget class

Acceptance criteria

  • Double-clicking "History" opens a viewport tab with revision cards
  • Revisions display newest-first with correct fields (number, status, author, timestamp, comment)
  • Status badges use Catppuccin-themed colors matching lifecycle state
  • Refresh button is visible but functional only when Silo connection is active
  • When offline, an "Offline — showing cached data" banner is displayed
  • Empty history (no revisions) shows a placeholder message
  • Inherits Catppuccin Mocha theme from application stylesheet

Dependencies

  • Phase 1 foundation (#37)
  • Phase 2 Manifest Viewer (#38) — for create_viewer_widget() factory

References

  • docs/KC_SPECIFICATION.md §4.3 (silo/history.json schema)
  • docs/SILO_VIEWPORT_PLAN.md Phase 4
  • Silo Metadata Viewport Specification §5.3 (History Viewer)
## Summary Implement the History Viewer — a read-only revision timeline that displays `silo/history.json` content, newest-first. Shows revision number, lifecycle status badge, author, timestamp, and commit comment for each revision. ## Widget specification ``` ┌──────────────────────────────────────────────────┐ │ Revision History [Refresh] │ ├──────────────────────────────────────────────────┤ │ Rev 3 · released · joseph · 2026-02-13 20:30 │ │ Added fillet to mounting holes │ │ ──────────────────────────────────────────── │ │ Rev 2 · draft · joseph · 2026-02-12 14:00 │ │ Initial geometry │ └──────────────────────────────────────────────────┘ ``` ### Layout - `QListView` with a custom `QStyledItemDelegate` rendering revision cards - Each card: revision number, status badge (colored per lifecycle), author, timestamp, comment - Refresh button fetches full server history if connected and updates the local snapshot - Offline: displays local `silo/history.json` snapshot with "Offline — showing cached data" banner ### Status badge styles (inline QSS) ```python BADGE_STYLES = { "draft": "background: #45475a; color: #cdd6f4;", "review": "background: #f9e2af; color: #11111b;", "released": "background: #a6e3a1; color: #11111b;", "obsolete": "background: #f38ba8; color: #11111b;", } ``` ### Tree icon `silo-history.svg` — clock, Catppuccin Lavender `#b4befe` (fallback empty string if not yet created) ## Files to modify | File | Change | |------|--------| | `src/Mod/Create/silo_viewers.py` | Add `SiloHistoryViewer` widget class | ## Acceptance criteria - [ ] Double-clicking "History" opens a viewport tab with revision cards - [ ] Revisions display newest-first with correct fields (number, status, author, timestamp, comment) - [ ] Status badges use Catppuccin-themed colors matching lifecycle state - [ ] Refresh button is visible but functional only when Silo connection is active - [ ] When offline, an "Offline — showing cached data" banner is displayed - [ ] Empty history (no revisions) shows a placeholder message - [ ] Inherits Catppuccin Mocha theme from application stylesheet ## Dependencies - Phase 1 foundation (#37) - Phase 2 Manifest Viewer (#38) — for `create_viewer_widget()` factory ## References - `docs/KC_SPECIFICATION.md` §4.3 (`silo/history.json` schema) - `docs/SILO_VIEWPORT_PLAN.md` Phase 4 - Silo Metadata Viewport Specification §5.3 (History Viewer)
forbes added the enhancement label 2026-02-18 21:16:10 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/silo-mod#40