Add Git Root Dir widget (#119)

* Add Git Root Dir widget

Add a new widget that displays the git repository root directory name.
- Shows directory name with 📁 icon (e.g., "📁 my-repo")
- Supports rawValue option for icon-free display
- Supports hideNoGit option to hide message when not in a git repo

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Change Git Root Dir widget icon to text label

Replace 📁 emoji with "Repo:" text label for better compatibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove label from Git Root Dir widget

Display only the repository name without any prefix.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix GitRootDir root path handling and raw mode

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Matthew Breedlove <sirmalloc@gmail.com>
This commit is contained in:
tim-watcha
2026-02-21 12:00:31 -05:00
committed by GitHub
co-authored by Claude Opus 4.5 Matthew Breedlove
parent 35b4c0caa0
commit f83e7d2f6d
5 changed files with 182 additions and 3 deletions
+1
View File
@@ -11,6 +11,7 @@ const widgetRegistry = new Map<WidgetItemType, Widget>([
['output-style', new widgets.OutputStyleWidget()],
['git-branch', new widgets.GitBranchWidget()],
['git-changes', new widgets.GitChangesWidget()],
['git-root-dir', new widgets.GitRootDirWidget()],
['git-worktree', new widgets.GitWorktreeWidget()],
['current-working-dir', new widgets.CurrentWorkingDirWidget()],
['tokens-input', new widgets.TokensInputWidget()],