Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@

## 🆕 Recent Updates

### Unreleased - Wakatime widget

- **⏱️ New Wakatime Today widget** - Added a `Wakatime Today` widget under the Usage category that reads the API key from `~/.wakatime.cfg` (honoring the standard `WAKATIME_HOME` override), fetches `users/current/statusbar/today`, and renders today's coding time (e.g. `WK 6h25m`). Cached for 60 seconds with a 2-second hard timeout, fail-silent on missing key / network errors, and configurable via the TUI: `f` cycles format (human/digital/text/decimal), `p` cycles prefix, `h` toggles hide-when-empty, `l` toggles a clickable OSC 8 link to the Wakatime dashboard.

### v2.2.9 - v2.2.12 - GitLab support, reset timers, context, compaction, and git widgets

- **🦊 GitLab PR/MR support** - `Git Branch` and `Git PR/MR` now support GitHub, GitLab, and compatible self-hosted remotes, using `gh` or `glab` as appropriate.
Expand Down
2 changes: 2 additions & 0 deletions docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ bun run example
- **Context Length** / **Context Window** / **Context %** / **Context % (usable)** / **Context Bar** - Show current context length, total context window size, used/remaining percentage, usable-window percentage, or a progress bar.
- **Compaction Counter** - Show how many context compactions have been detected in the current session. It can render as icon plus number, text plus number, or number-only, and can hide while the count is zero.
- **Session Usage** / **Weekly Usage** / **Block Timer** / **Block Reset Timer** / **Weekly Reset Timer** - Show usage percentages plus current block/reset timing. Session and weekly usage bars can show a time cursor; reset timers can show remaining time, progress, or exact reset date/time with timezone and locale controls.
- **Wakatime Today** - Show today's coding time from Wakatime (e.g. `WK 6h25m`). Reads the API key from `~/.wakatime.cfg` (honors the standard `WAKATIME_HOME` override), caches the result for 60 seconds, and renders empty when the key is missing or the request times out (2-second hard timeout). Configurable format (human/digital/text/decimal), prefix, hide-when-empty, and an optional clickable OSC 8 link to the Wakatime dashboard.
Comment thread
drPod marked this conversation as resolved.
Outdated

### Environment, Layout & Custom

Expand Down Expand Up @@ -160,6 +161,7 @@ Widget-specific shortcuts:
- **Context % widgets**: `u` toggle used vs remaining display, `p` cycle percentage/short bar/short bar only
- **Session Usage / Weekly Usage**: `p` cycle percentage/full bar/medium bar/short bar/short bar only, `v` invert fill in progress mode, `t` toggle the time cursor in bar modes
- **Block Timer**: `p` cycle time/full bar/short bar, `s` toggle compact time, `v` invert fill in progress mode
- **Wakatime Today**: `f` cycle format (human/digital/text/decimal), `p` cycle prefix, `h` hide when empty, `l` toggle clickable dashboard link
- **Block Reset Timer**: `p` cycle time/full bar/short bar, `s` toggle compact time/date, `t` toggle exact reset date/time, `h` toggle 12/24-hour display in date mode, `z` edit timezone in date mode, `l` edit locale in date mode, `v` invert fill in progress mode
- **Weekly Reset Timer**: `p` cycle time/full bar/short bar, `s` toggle compact time/date, `t` toggle exact reset date/time, `h` toggle hours-only in time mode or 12/24-hour display in date mode, `z` edit timezone in date mode, `l` edit locale in date mode, `v` invert fill in progress mode
- **Context Bar**: `p` cycle medium/full/short/short-only progress bar
Expand Down
3 changes: 3 additions & 0 deletions src/ccstatusline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
isWidgetSpeedWindowEnabled
} from './utils/speed-window';
import { prefetchUsageDataIfNeeded } from './utils/usage-prefetch';
import { prefetchWakatimeDataIfNeeded } from './utils/wakatime-prefetch';

function hasSessionDurationInStatusJson(data: StatusJSON): boolean {
const durationMs = data.cost?.total_duration_ms;
Expand Down Expand Up @@ -129,6 +130,7 @@ async function renderMultipleLines(data: StatusJSON) {
}

const usageData = await prefetchUsageDataIfNeeded(lines, data);
const wakatimeData = await prefetchWakatimeDataIfNeeded(lines);
Comment thread
drPod marked this conversation as resolved.
Outdated

let speedMetrics: SpeedMetrics | null = null;
let windowedSpeedMetrics: Record<string, SpeedMetrics> | null = null;
Expand Down Expand Up @@ -174,6 +176,7 @@ async function renderMultipleLines(data: StatusJSON) {
speedMetrics,
windowedSpeedMetrics,
usageData,
wakatimeData,
sessionDuration,
skillsMetrics,
compactionData: hasCompactionWidget ? { count: compactionCount } : null,
Expand Down
9 changes: 9 additions & 0 deletions src/types/RenderContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ export interface RenderUsageData {
error?: 'no-credentials' | 'timeout' | 'rate-limited' | 'api-error' | 'parse-error';
}

export interface RenderWakatimeData {
digital?: string;
text?: string;
decimal?: string;
totalSeconds?: number;
error?: 'no-credentials' | 'timeout' | 'api-error' | 'parse-error';
}

export interface CompactionData { count: number }

export interface RenderContext {
Expand All @@ -27,6 +35,7 @@ export interface RenderContext {
speedMetrics?: SpeedMetrics | null;
windowedSpeedMetrics?: Record<string, SpeedMetrics> | null;
usageData?: RenderUsageData | null;
wakatimeData?: RenderWakatimeData | null;
sessionDuration?: string | null;
blockMetrics?: BlockMetrics | null;
skillsMetrics?: SkillsMetrics | null;
Expand Down
Loading
Loading