0.5.1: TUI cleanup + accurate skill cost#10
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BINDINGSnow actually fire on tab-switch — every screen.focus()s its primaryDataTableinon_show, replacing the previous silent no-op when focus stayed onTabbedContent's tab strip.d(delete) and Permsp/D(prune-stale, dedup) are now interactive with preview/confirm modals + audit logging. Sessions/search and Audituundo are dropped; users are pointed at the CLI equivalents.a/r/n/p).enabled_skillscost is accurate. Previously counted full SKILL.md size as per-request tokens; now readsskillListingMaxDescChars(default 1536) from~/.claude/settings.jsonand truncates each skill body to that cap. HonoursskillOverrides("off","name-only"). Heavy skills previously over-reported ~16x.Test plan
uv run ruff check src tests— cleanuv run pytest -q— 319 passed (was 302; +17 new tests covering focus, sessions delete, perms preview modals, skill cost cap + overrides)d→ confirm in modal → row removedp→ preview modal lists stale rules → confirm → stale rules disappearcc-janitor context costshows realistic skill tokens after the 1536-char cap🤖 Generated with Claude Code