Skip to main content

Overview

WikiOnitViewer displays ongoing work sessions with simple, chronological organization. Each OnIt session represents active work that’s “on it” - capturing ideas, exploration, and progress in real-time.

Architecture

The viewer follows a flat file structure with timestamp-based naming, using a 6-pattern parser for maximum compatibility across historical naming conventions.
┌─────────────────────────────────────────────────┐
│  WikiOnitViewer Structure                       │
├─────────────────────────────────────────────────┤
│                                                 │
│  WikiBaseViewer (base class)                    │
│       ↓                                         │
│  WikiOnitViewer (350 lines)                     │
│       ↓                                         │
│  sessions: OnitSession[]                        │
│       ↓                                         │
│  Render → Accordion List (chronological)        │
│                                                 │
└─────────────────────────────────────────────────┘

Data Model

Each session includes parsed timestamp, session name, and inferred status based on modification time. OnitSession Interface:
  • date: YYYY-MM-DD format
  • time: HH:MM or HH:MM:SS (with seconds)
  • sessionName: Extracted from filename
  • pattern: Which of 6 patterns matched (1-6)
  • sortKey: Normalized timestamp for sorting
  • status: active, completed, or archived
Status Inference:
  • Active: Modified within last 24 hours (green)
  • Completed: In WIP folder, not recently modified (blue)
  • Archived: Graduated to wiki folder (gray)

Filename Patterns

The viewer uses an external 6-pattern parser achieving 100% coverage of 1,873 historical files:
PatternFormatCoverage
1YYYY-MM-DD-HH-MM-SS-name.md39.1%
2YYYY-MM-DD-HH-MM-SS.md1.4%
3YYYY-MM-DD-HH-MM-name.md31.7%
4YYYY-MM-DD-name.md1.5%
5NN-TOPIC-YYYY-MM-DD-HH-MM.md0.4%
6TOPIC-NAME.md (fallback)25.6%
This multi-pattern approach handles historical variations while maintaining backward compatibility.

Rendering System

The render system generates a flat accordion list with status-based color coding. Main Components:
  • Header: Shows “OnIt (N)” with session count
  • Session List: Chronological accordion items (newest first)
  • Status Badges: Color-coded status indicators
  • Empty State: Contextual help for WIP vs Wiki modes
Date Display Logic:
  • Last 24 hours: Show time (e.g., “14:30”)
  • Last 48 hours: Show “yesterday”
  • Older: Show full date (YYYY-MM-DD)

Interaction Patterns

Two main interaction types:

WIP/Wiki Toggle

Switches between work-in-progress sessions and archived sessions by changing the filesystem path.
WIP:  ~/Library/.../wip/onit/
Wiki: ~/Library/.../wiki/onit/

Accordion Expansion

Click session header to load and display markdown content inline. Content is cached after first load for instant re-expansion. Accordion States:
  1. Collapsed (initial): Content hidden
  2. Loading: Shows “Loading…” message
  3. Expanded: Renders full markdown with sticky header
  4. Cached: Preserves loaded content when collapsed

State Management

Minimal state design following SMPC principles: State Properties:
  • sessions: OnitSession[] (only custom state)
  • Inherited from base: container, projectSlug, category, isWip, settings
State Lifecycle:
  1. Initialize → Load sessions → Render → Attach listeners
  2. Toggle → Update isWip → Refresh (reload + re-render)
  3. Refresh → Replace sessions array → Full DOM re-render
State is unidirectional: User action → State update → DOM re-render. No reverse binding.

Comparison with Prepare Viewer

FeatureOnItPrepare
Lines of code350789
Data structureFlat filesFolders + files
Status states34 (projects)
Display modes1 (list)2 (cards + list)
Filename patterns61
Progress trackingNoYes (checkboxes)
OnIt is the simplest wiki viewer due to its flat structure and single display mode.
THE CENTER
Visibility enables the Human-AI feedback loop

Technical Credibility

Built on Rust IPC, Tauri commands, and xterm.js rendering. Uses external parser module for filename compatibility. Inherits shared infrastructure from WikiBaseViewer abstract class.