Skip to content

0.5.1: TUI cleanup + accurate skill cost#10

Merged
CreatmanCEO merged 8 commits into
mainfrom
fix/0.5.1-tui-cleanup
May 22, 2026
Merged

0.5.1: TUI cleanup + accurate skill cost#10
CreatmanCEO merged 8 commits into
mainfrom
fix/0.5.1-tui-cleanup

Conversation

@CreatmanCEO
Copy link
Copy Markdown
Owner

Summary

  • TUI honesty pass. Per-screen BINDINGS now actually fire on tab-switch — every screen .focus()s its primary DataTable in on_show, replacing the previous silent no-op when focus stayed on TabbedContent's tab strip.
  • Sham bindings removed or made real. Sessions d (delete) and Perms p/D (prune-stale, dedup) are now interactive with preview/confirm modals + audit logging. Sessions / search and Audit u undo are dropped; users are pointed at the CLI equivalents.
  • Schedule key names finally agree across BINDINGS, header text, F1 help, and the empty-state CTA (a/r/n/p).
  • enabled_skills cost is accurate. Previously counted full SKILL.md size as per-request tokens; now reads skillListingMaxDescChars (default 1536) from ~/.claude/settings.json and truncates each skill body to that cap. Honours skillOverrides ("off", "name-only"). Heavy skills previously over-reported ~16x.

Test plan

  • uv run ruff check src tests — clean
  • uv run pytest -q — 319 passed (was 302; +17 new tests covering focus, sessions delete, perms preview modals, skill cost cap + overrides)
  • Open TUI → Sessions tab → highlight a row → press d → confirm in modal → row removed
  • Open TUI → Permissions tab → p → preview modal lists stale rules → confirm → stale rules disappear
  • cc-janitor context cost shows realistic skill tokens after the 1536-char cap

🤖 Generated with Claude Code

CreatmanCEO and others added 8 commits May 22, 2026 10:10
Screen-level BINDINGS only fire when focus chain includes the widget.
Previously focus stayed on TabbedContent tab strip, so per-screen keys
silently no-op'd until the user manually tabbed into the inner DataTable.

Add on_show to every screen widget that focuses the primary DataTable
each time its tab becomes active.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three sources previously disagreed: header said "n new job · Del remove
· r run now" but actual BINDINGS were a/r/n/p (add/remove/run-now/
promote). Now all three sources (BINDINGS, header text, F1 help, empty-
state CTA) agree on a/r/n/p.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the action_delete notify-placeholder with a real interactive
flow: highlight row -> press d -> ConfirmModal asks about soft-delete
with size/message-count -> on Yes, calls core.sessions.delete_session
inside tui_confirmed() + audit_action(mode="tui"), then removes the
row from the DataTable. Restoration via 'cc-janitor trash restore'
remains a CLI path.

Also drops the / search sham binding (no implementation existed).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace two notify-placeholder action_* methods with real interactive
flows. PrunePreviewModal lists stale rules (no 90d matches) with source
paths; on confirm, iterates core.permissions.remove_rule which backs up
each settings.json to ~/.cc-janitor/backups/ and writes audit log entry
(mode=tui). DedupPreviewModal lists which duplicate-group rule(s) would
be removed (keeps first, drops the rest; conflict groups are never
auto-fixed).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Remove the `u` action_undo notify-placeholder from Audit screen.
Header + F1 help now direct users to 'cc-janitor undo' CLI command,
which already implements full undo via the audit log replay.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previously enabled_skills counted full SKILL.md byte-size as per-request
token cost. Claude Code actually truncates each skill body at
skillListingMaxDescChars (default 1536), so a 50KB skill is only ~400
tokens per request — cc-janitor was overreporting by ~16x.

- Read skillListingMaxDescChars from ~/.claude/settings.json (default 1536).
- Read skillOverrides; "off" excludes the skill, "name-only" keeps only
  YAML frontmatter.
- size_bytes still reflects the full file; tokens reflect the truncated
  slice that actually loads per request.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CreatmanCEO CreatmanCEO merged commit c294088 into main May 22, 2026
4 checks passed
@CreatmanCEO CreatmanCEO deleted the fix/0.5.1-tui-cleanup branch May 22, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant