Repository navigation
feat(shell): splashboard init <shell> for rc integration (#6) - #26
Conversation
One-line install: \`eval "$(splashboard init zsh)"\` wires up chpwd so
every \`cd\` renders the splash. This is what unlocks the
per-directory dashboard UX — without the hook, users have to type
\`splashboard\` manually.
Supports bash / zsh / fish / powershell. Each snippet is bundled via
include_str! from src/shells/*.{sh,fish,ps1} and guards for
interactive context so sourcing from a login-shell or CI script is a
no-op.
- bash: PROMPT_COMMAND hook with PWD-change detection (native chpwd
doesn't exist in bash); guarded on \$- containing 'i'.
- zsh: add-zsh-hook chpwd; guarded on -o interactive.
- fish: function --on-variable PWD; guarded on status is-interactive.
- powershell: \$ExecutionContext.InvokeCommand.LocationChangedAction.
CLI gains clap-driven argument parsing. The default \`splashboard\`
(no subcommand) still renders the splash and now short-circuits with
exit 0 when stdout isn't a terminal (pipe, CI, script source).
Extracted the stub widget payload builders to src/stubs.rs to keep
main.rs focused on CLI dispatch. Those will be replaced by real
fetchers as #4 + widget issues land.
Closes #6
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 26 minutes and 13 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Previously the cd hook ran the full resolution (walk-up + global fallback) every time, which meant every subdirectory navigation inside a project re-rendered the same splash. New behavior: - splashboard → full resolution (for shell startup) - splashboard --on-cd → current-dir-only, skip silently if absent Semantic: the splash appears once when you cross into a project root, then stays quiet on subdirectory navigation within that project, and re-appears when you cd into a different project root. Matches the "entering a project" mental model. Shell snippets updated to call --on-cd on their cd hooks and bare splashboard on shell startup. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Stdout-is-a-TTY alone wasn't enough. Extra skip signals: - Require stdin is also a terminal (catches piped-stdin wrappers). - Skip when CI env var is set (GitHub Actions, GitLab CI, etc.). - Skip when TERM=dumb. - Opt-out env vars for users to silence splashboard in AI IDE / automation contexts: SPLASHBOARD_SILENT, NO_SPLASHBOARD. Also: render errors are now swallowed silently rather than bubbled up, so a broken splash never noisies up the user's shell startup. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Viewport::Inline(16) + the default 2×3 grid look broken when the terminal is narrower than ~40 cols or shorter than the inline viewport. Check size via crossterm before engaging the render path; below minimum, exit silently (same as other guards). Bails out conservatively when size can't be determined. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Ships the cd-hook that unlocks the killer feature (per-directory dashboards). One-line install:
Drop the eval into your rc file and every new shell renders the splash. On every
cd, if the destination directory directly holds a.splashboard.tomlor.splashboard/config.toml, the splash re-renders; otherwise it stays quiet. Combined with the discovery from #2, the splash appears once per project entry, not on every subdirectory navigation.CLI
splashboardnow uses clap:splashboardsplashboard --on-cdsplashboard init <shell>Render guards
Both render modes no-op when the environment is unsuitable:
stdoutorstdinis not a terminal (pipe, CI, rc sourcing, non-interactive)CIenv var is set (GitHub Actions, GitLab, etc.)TERM=dumbSPLASHBOARD_SILENTorNO_SPLASHBOARDis set (user opt-out for AI IDE terminals, automation sessions, etc.)Render errors are swallowed silently — a broken splash will never noisify the user's shell startup.
Snippets
Each bundled via
include_str!fromsrc/shells/:PROMPT_COMMAND+ PWD-change detection[[ $- == *i* ]]add-zsh-hook chpwd[[ -o interactive ]]function --on-variable PWDstatus is-interactive$ExecutionContext.InvokeCommand.LocationChangedActionEach snippet calls
splashboardon startup andsplashboard --on-cdon cd events.Refactor
Extracted stub widget payload builders from
main.rstosrc/stubs.rs.main.rsnow focuses on CLI dispatch and render-mode selection. Stubs will be replaced by real fetchers when #4 async/cache + widget issues land.Test plan
cargo build(zero warnings)cargo test(59 passed: 12 payload + 12 render + 9 layout + 14 config + 6 shell + 6 render-guard)cargo clippy --all-targets -- -D warningscargo fmt --checksplashboard init <shell>emits its snippet;splashboard | catexits 0 silently (non-TTY guard).Closes #6.
🤖 Generated with Claude Code