Preface¶
In the session tabs of DSH Web, aside from viewing context and conversation history, there is often a lack of direct observation regarding the dimension of time. This plugin adds a “Time Stats” tab to the right of the session tabs (following the “Context” of dsh-context). By reading three existing session channels (sessionStats, turnTimings, timeline), it performs local collapsing calculations to visually present the session’s wall-clock span, active and idle states, a Gantt chart for each turn, and the hourly distribution. All data is sourced from existing channels; it does not scan the disk, read caches, or make additional network requests.
Core Features¶
The plugin primarily provides the following data display capabilities:
- Session Overview: Displays the number of turns, steps, wall-clock span, active duration, idle rate, and the timestamp of the first message.
- Usage Timeline (Gantt Chart): One bar per turn, where blank spaces represent idle time.
- Hourly Distribution: A 24-bar histogram showing which hour each step started in.
- Turn Duration Ranking: Lists the 5 longest turns.
- Calendar (P2 Feature): Supports cumulative totals for today/this week/this month, a heatmap for the last 12 weeks, a bar chart for the last 14 days, and statistics on continuous usage segments. Data is sourced from the host’s
usageDailyprojection and summed across sessions. - Sessions (P2 Feature): Provides three views—a vertical table grouped by workspace (with inline proportion bars), a daily activity band (14 columns), and a master-detail dual-pane layout (list on the left, details on the right).
Installation and Activation¶
This plugin is installed via the DSH ecosystem directory.
* Directory URL: https://www.skillhub.cn/plugins/CNyaotian-Lunar/dsh-usage-tab
* Repository URL: https://github.com/CNyaotian-Lunar/dsh-usage-tab
Typical Usage¶
- Add Tab: Add the “Time Stats” tab to the DSH Web session tabs.
- Configure Interface: Use the secondary menu to switch between Overview/Calendar/Sessions/Settings, and adjust the idle threshold, timezone, or data range in the settings.
- Verify Backfill: Run
node tools/projcache-probe.mjsto compare data coverage before and after backfilling. - View Data: Check cross-session aggregated data for today/this week/this month on the Calendar page, or view specific workspace time distributions on the Sessions page.
Scenarios and Notes¶
- P1 and P2 Status: P1 status supports only the current session, with all data coming from existing channels; P2 features (Calendar, Sessions pages) require the host side to register the
usageDailyprojection unit. Cold session backfill executes 5 seconds after startup. - Empty Data States: When projection data is unavailable, the interface remains empty (values are consistently
—). - List Limitations: The session list is capped at
SESSION_LIST_LIMIT = 40; sessions exceeding this number will be truncated in specific views. - Restart Required: Changes to both the host side (
lib/index.mjs) and the client side (lib/client.js) require restarting the desktop App to take effect. - Dependency Requirements: Requires DSH version >= 0.1.0.
Conclusion¶
By utilizing local computation and reading projection data, this plugin provides DSH users with refined session time analysis capabilities. For scenarios requiring monitoring of development efficiency or analysis of AI behavior patterns, it offers direct measurement tools.