Skip to content

Commit 05cd033

Browse files
committed
docs: update pcd interactive mode documentation
Updated CLAUDE.md and README.md to reflect recent improvements: - Visual styling enhancements (color-coded indicators, decorative UI) - Navigation timestamp tracking fixes - Accurate last-used times in interactive mode 🤖 Co-Authored-By: Claude Code <noreply@anthropic.com>
1 parent c0b5c98 commit 05cd033

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

CLAUDE.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ src/
7171
- `src/PSCue.Module/PersistenceManager.cs`: SQLite-based cross-session persistence with 10 tables
7272
- `src/PSCue.Module/PcdCompletionEngine.cs`: Enhanced PCD algorithm with fuzzy matching, frecency scoring, filesystem search, symlink resolution (Phases 17.6 + 17.9 + 19.0 + 21.1)
7373
- `src/PSCue.Module/PcdConfiguration.cs`: Shared configuration for PCD (tab completion + predictor) (Phase 19.0 + 21.2)
74-
- `src/PSCue.Module/PcdInteractiveSelector.cs`: Interactive directory selection using Spectre.Console
74+
- `src/PSCue.Module/PcdInteractiveSelector.cs`: Interactive directory selection with visual styling (color-coded indicators, decorative UI)
75+
- `src/PSCue.Module/FeedbackProvider.cs`: Learns from command execution, records navigation paths with trailing separators
7576
- `src/PSCue.Shared/CommandCompleter.cs`: Completion orchestration
7677
- `module/Functions/LearningManagement.ps1`: PowerShell functions for learning system
7778
- `module/Functions/DatabaseManagement.ps1`: PowerShell functions for database queries
@@ -146,12 +147,15 @@ Invoke-PCD [path] # Long-form function name
146147
# - Filesystem search: Shows unlearned directories via child + recursive search
147148
# - Interactive selection: `pcd -i` shows visual menu to browse and select from learned directories
148149
# - Uses Spectre.Console for cross-platform interactive UI
149-
# - Display format: path + usage stats (visits, last used time)
150-
# - Keyboard navigation: Arrow keys, type to search, Enter to select; "< Cancel >" option or Esc to cancel
150+
# - Visual styling: Decorative header with folder icon, color-coded usage indicators (green/yellow/grey dots), time-based coloring
151+
# - Display format: Bold paths with ~ shortening + usage stats (visits, last used time with recency colors)
152+
# - Keyboard navigation: Arrow keys, type to search (with search icon), Enter to select; "< Cancel >" option or Esc to cancel
153+
# - Highlight style: Cyan on grey background with bold for selected item
151154
# - Same frecency scoring as tab completion for consistency
152155
# - Filters out non-existent directories automatically
153156
# - Excludes current directory and .. parent shortcut (neither is useful to navigate to interactively)
154157
# - Default shows top 20, configurable via -Top parameter (range: 5-100)
158+
# - Timestamp tracking: All pcd navigations manually record under 'cd' command for accurate stats
155159
# - Best-match navigation: `pcd <partial>` finds closest fuzzy match without tab
156160
# - Directory name matching: "dd-trace-dotnet" matches "D:\source\datadog\dd-trace-dotnet" from any location
157161
# - Searches top 200 learned paths (not just top 20) for better match coverage
@@ -275,6 +279,7 @@ public void TestLearningAccess()
275279
15. **install-local.ps1 dependency list**: The local install script has a hardcoded `$Dependencies` array listing DLLs to copy from the `publish/` directory. When adding new NuGet packages (e.g., Spectre.Console), you MUST add the DLL to this list or the module will fail at runtime with assembly-not-found errors. Consider replacing this with a bulk copy approach (like `install-remote.ps1` does) to avoid this pitfall.
276280
16. **PCD interactive selector excludes current dir and `..`**: `PcdInteractiveSelector` explicitly filters out the current directory and the `..` parent shortcut. This is intentional — navigating to where you already are is useless, and `..` is always available via `pcd ..` directly. When testing, ensure the learned paths are not just the current directory or its parent.
277281
17. **FeedbackProvider uses PowerShell `$PWD` for path normalization**: The `FeedbackProvider` uses the PowerShell `$PWD` variable (not `System.Environment.CurrentDirectory`) to get the current working directory for path normalization. This is important because `Set-Location` in PowerShell does not update the process CWD. Always use `PSCmdlet.SessionState.Path.CurrentLocation` or invoke `$PWD` via PowerShell when you need the true PowerShell working directory.
282+
18. **Navigation timestamp tracking**: For navigation commands (cd, Set-Location, sl, chdir), the FeedbackProvider records the absolute destination path (from context.CurrentLocation after navigation) with trailing separator, not the relative path typed. The `pcd` function manually records navigations under the 'cd' command since FeedbackProvider only sees the 'pcd' command, not the internal Set-Location calls. Without this, pcd navigations wouldn't update learned directory timestamps.
278283

279284
## Documentation
280285
- **Implementation status**:

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,9 @@ pcd --interactive -Top 30
270270
```
271271

272272
Features:
273-
- **Visual menu**: Arrow keys to navigate, type to search/filter, Enter to select
274-
- **Cancel options**: Select "< Cancel >" (first item in list) or press Esc to exit without navigating
275-
- **Usage statistics**: Shows visit count and last used time for each directory
276-
- **Smart filtering**: Only shows directories that still exist on disk; excludes current directory and `..` parent shortcut
277-
- **Frecency sorting**: Same scoring as tab completion (frequency + recency + distance)
273+
- **Interactive menu**: Arrow keys to navigate, type to search, Enter to select, Esc to cancel
274+
- **Visual polish**: Color-coded usage indicators and timestamps for easy scanning
275+
- **Smart filtering**: Only shows existing directories, same frecency scoring as tab completion
278276
- **Configurable**: Show 5-100 entries with `-Top` parameter
279277

280278
Requires a TTY-capable terminal (Windows Terminal recommended). See [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md#pcd-smart-directory-navigation) for edge cases and terminal compatibility details.

0 commit comments

Comments
 (0)