Rendering Pipeline
The render system transforms parsed OnitSession data into interactive HTML through a hierarchical method structure.Render Methods
Method Inventory (7 total):| Method | Purpose |
|---|---|
render() | Main orchestrator |
renderSessionList() | Session accordion container |
renderSessionItemHtml() | Individual session item |
createStatusIconElement() | Status icon SVG |
getStatusBgColor() | Background color for status |
getStatusTextColor() | Text color for status |
renderEmptyMessage() | Empty state display |
renderHeader() and getViewerStyles() for consistent UI across all wiki viewers.
Session Item Structure
Each session renders as an accordion item with status indicators and metadata. Visual Layout:- Arrow icon: 16×16px, rotates 90° when expanded
- Status dot: 6×6px circle, color matches status badge
- Session name: Flex:1, truncates with ellipsis
- Date/time: 11px font, never truncates
- Status badge: 10px font, 2px padding, rounded corners
Status Visualization
Three status types with consistent color coding:| Status | Color | RGB | Background | Icon |
|---|---|---|---|---|
| Active | Green | rgb(16, 185, 129) | 15% opacity | CheckCircle |
| Completed | Blue | rgb(59, 130, 246) | 15% opacity | CheckCircle |
| Archived | Gray | rgb(107, 114, 128) | 15% opacity | Package |
- Active:
modifiedAtwithin 24 hours - Completed: In WIP folder, older than 24 hours
- Archived: In wiki folder (not WIP)
Date Formatting
Smart date display based on recency: Formatting Logic:- Modified 2 hours ago: “14:30”
- Modified yesterday: “yesterday”
- Modified 3 days ago: “2025-12-25”
Event System
Two-layer event handling with base class integration.Toggle Listeners
Inherited from WikiBaseViewer, handles WIP/Wiki switching: Flow:- User clicks [WIP] or [Wiki] button
- Get
data-modeattribute - Update
isWipflag - Call
refresh()(reload data + re-render)
- Changes filesystem path (
wip/onit/↔wiki/onit/) - Loads different session set
- Resets all UI state (accordion expansions lost)
Accordion Listeners
Handles session expansion/collapse with content loading: Flow:- User clicks session header
- Query
.wiki-accordion-itemwrapper - Get
data-doc-pathattribute - Call
toggleAccordion()from base class
- Content caching: No re-load on re-expand
- Sticky headers: Header sticks during scroll
- Smooth scrolling:
scrollIntoView()on expand
Sticky Header Behavior
When accordion expands, its header becomes sticky below the viewer header. Calculation:Empty State
Context-aware empty state message based on current mode: WIP Mode:Refresh Mechanism
Complete data reload and UI re-render: Refresh Flow:- All accordion expansions collapse
- Cached content is discarded
- Scroll position may reset
- Only first session expanded (default)
Content Export
ThegetContent() method provides plain text export for clipboard:
Format:
[{date} {time}] {sessionName} ({status})
Separator: Newline (\n)
Use cases: Copy to clipboard, export to file
THE CENTER
Simple interactions preserve focus on content
Technical Credibility
Uses CSS custom properties for theming. Implements accordion pattern from WikiBaseViewer. Status colors match Tailwind’s color palette for consistency. All render methods are synchronous except content loading via IPC.