Skip to content

Add television cable channels for Ansible-managed configs#104

Open
boga wants to merge 1 commit into
masterfrom
tv-channels
Open

Add television cable channels for Ansible-managed configs#104
boga wants to merge 1 commit into
masterfrom
tv-channels

Conversation

@boga

@boga boga commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Why

The television fuzzy-finder cable channels (channels, dirs, env, files,
gh-prs, git-log, path, recent-files, text) were only configured manually
and not tracked by the Ansible playbook, so they weren't reproducible
across machines.

Approach

Followed the existing config_files role pattern used for all other
dotfiles instead of creating a new role — keeps deployment consistent
with how every other templated config (Zed, Kitty, Starship, etc.) is
managed.

How it works

Copied the 9 cable channel .toml files into
templates/television/cable/ and registered each as an entry in
config_files (group_vars/all.yml), so the config_files role
templates them to ~/.config/television/cable/*.toml on playbook run.

Links

  • N/A

Summary by CodeRabbit

  • New Features
    • Added several new Televisions cable views for browsing channels, directories, files, environment variables, git history, paths, recent files, text matches, and open pull requests.
    • Added quick actions for common workflows like opening files, entering directories, checking out branches, merging pull requests, and opening selected items in an editor or shell.
    • Improved previews with richer, colorized details for easier at-a-glance review.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds nine new Television cable channel TOML templates (channels, dirs, env, files, gh-prs, git-log, path, recent-files, text) under templates/television/cable/, each defining source, preview, keybindings, and actions, and registers them as config_files entries in group_vars/all.yml.

Changes

Television cable channels

Layer / File(s) Summary
Config file registration
group_vars/all.yml
Adds config_files entries mapping new cable templates to destinations under ~/.config/television/cable/.
Channels meta-picker
templates/television/cable/channels.toml
Lists available channels via tv list-channels, previews selected channel TOML with bat, and enters via tv {}.
Directory browsing channel
templates/television/cable/dirs.toml
Lists directories via fd, previews with ls -la, and defines cd/goto_parent_dir actions with f2 keybinding.
Environment variable channel
templates/television/cable/env.toml
Lists env vars via printenv, previews values, and adds actions.name with f3 shortcut.
File browsing channel
templates/television/cable/files.toml
Lists files via fd variants, previews via bat, and adds edit/goto_parent_dir actions with keybindings.
GitHub PR channel
templates/television/cable/gh-prs.toml
Lists open PRs via gh/jq, renders detailed preview, and adds browse/checkout/merge/diff actions.
Git log channel
templates/television/cable/git-log.toml
Lists commits via git log, previews via git show, and adds cherry-pick/revert/checkout actions.
PATH entries channel
templates/television/cable/path.toml
Splits $PATH entries, previews directory contents, and adds a cd action.
Recent files channel
templates/television/cable/recent-files.toml
Lists recently modified files via git diff/find, previews via bat, and adds enter-to-edit action.
Text search channel
templates/television/cable/text.toml
Searches text via rg variants, previews with line offset via bat, and adds edit/echo actions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Related PRs: None specified.

Suggested labels: enhancement, documentation, config

Suggested reviewers: None specified.

🐰 Nine new channels hop into view,
Cable configs, fresh and new,
Files, dirs, PRs, and git logs too,
Television's warren grows anew!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: adding Television cable channels managed through Ansible configs.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tv-channels

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@boga boga changed the title feat(television): add cable channels for channels, dirs, env, files, … Add television cable channels for Ansible-managed configs Jul 2, 2026
@boga boga marked this pull request as ready for review July 2, 2026 13:04

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
templates/television/cable/path.toml (1)

1-11: 📐 Maintainability & Code Quality | 🔵 Trivial

Fragile reliance on TOML basic-string \n escaping.

Since these are TOML basic (double-quoted) strings, \n is decoded by the TOML parser itself into a literal newline character before the shell ever sees it — it isn't passed through as the two characters \ n. The commands happen to still work here because both usages sit inside single-quoted shell segments ('%s\n', ':'/'\n') where an embedded raw newline behaves the same as the intended escape, but this is coincidental and easy to break with future edits.

♻️ Suggested fix — use a literal string so backslashes are passed through unmodified
 [source]
-command = "printf '%s\n' \"$PATH\" | tr ':' '\n'"
+command = '''printf '%s\n' "$PATH" | tr ':' '\n' '''

 [preview]
-command = "fd -tx -d1 . \"{}\" -X printf \"%s\n\" \"{/}\" | sort -f | bat -n --color=always"
+command = '''fd -tx -d1 . "{}" -X printf "%s\n" "{/}" | sort -f | bat -n --color=always'''
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/television/cable/path.toml` around lines 1 - 11, The command
strings in the path TOML rely on basic-string \n escaping, which TOML decodes
before the shell sees it and makes the intent fragile. Update the source and
preview command values in the path template to use a TOML literal string style
so the shell receives backslashes unchanged, and keep the behavior tied to the
existing command entries under the [source] and [preview] sections.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@templates/television/cable/path.toml`:
- Around line 1-11: The command strings in the path TOML rely on basic-string \n
escaping, which TOML decodes before the shell sees it and makes the intent
fragile. Update the source and preview command values in the path template to
use a TOML literal string style so the shell receives backslashes unchanged, and
keep the behavior tied to the existing command entries under the [source] and
[preview] sections.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ba9b735-8c54-40d0-83a2-25274a2588ee

📥 Commits

Reviewing files that changed from the base of the PR and between 00c1198 and d0a41bf.

📒 Files selected for processing (10)
  • group_vars/all.yml
  • templates/television/cable/channels.toml
  • templates/television/cable/dirs.toml
  • templates/television/cable/env.toml
  • templates/television/cable/files.toml
  • templates/television/cable/gh-prs.toml
  • templates/television/cable/git-log.toml
  • templates/television/cable/path.toml
  • templates/television/cable/recent-files.toml
  • templates/television/cable/text.toml

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