3dyuval / 3dyuval/nvim

Enhancement: Improve code navigation with path copying and structural navigation

Abierto
#20 3 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Fennel
Estrellas
0
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

# Navigation Workflow Enhancement: Unified Breadcrumb System

## User Story

As a developer working with complex codebases, I need a **unified navigation system** that works seamlessly across file exploration and code structure navigation, so I can efficiently copy paths, jump between contexts, and maintain my workflow momentum.

## Current Navigation Workflow Gaps

### Context Switching Friction
Currently, our navigation involves multiple disconnected systems:
- **File navigation**: Snacks explorer with `` context menu (copy file paths)
- **Code navigation**: nvim-navic breadcrumbs (display only, no interaction)
- **Symbol discovery**: Separate pickers with different keybindings

This creates **cognitive overhead** when switching between file-level and symbol-level navigation tasks.

## Desired Unified Experience

### Single Keybinding Philosophy: ``
Extend the existing **Snacks explorer `` pattern** to work context-aware across all navigation scenarios:

**In Snacks Explorer** → Copy file paths (current behavior)
**In Editor Window** → Smart breadcrumb actions based on cursor context

### Enhanced Use Cases

#### Use Case 1: Symbol Path Copying
**Story**: Working on a complex object hierarchy and need to reference the current symbol path
- **Given**: Cursor on code symbol (e.g., `foo.bar.baz`)
- **When**: Press ``
- **Then**: Show path copy menu with multiple formats (dot notation, bracket notation, etc.)
- **Integration**: Reuse Snacks picker-extensions menu system

#### Use Case 2: File Breadcrumb Navigation
**Story**: Using VSCode-style breadcrumb to quickly jump to file context
- **Given**: Cursor not on parsable code object
- **When**: Press ``
- **Then**: Jump to file breadcrumb navigation in winbar
- **Integration**: Leverage existing navic winbar infrastructure

#### Use Case 3: Breadcrumb Context Menu
**Story**: Right-click style interaction with breadcrumb items
- **Given**: Cursor on breadcrumb item in winbar
- **When**: Press ``
- **Then**: Show context menu for that breadcrumb segment
- **Integration**: Extend picker-extensions context system

## Implementation Strategy

### Phase 1: Unified Keybinding System
- **Extend existing `` behavior** used in Snacks explorers
- **Smart context detection**: Picker vs. editor vs. breadcrumb contexts
- **Zero breaking changes**: Preserve all current Snacks functionality

### Phase 2: Enhanced Path Copying
- **Leverage tree-sitter breadcrumbs**: Use discovered `nvim_treesitter#statusline()`
- **Extend picker-extensions formats**: Add symbol-specific path formats
- **LSP fallback**: Use navic when tree-sitter unavailable

### Phase 3: Breadcrumb Interaction
- **Navic winbar integration**: Use existing breadcrumb display
- **Custom click detection**: Workaround missing winbar APIs
- **Context menu reuse**: Extend picker-extensions for breadcrumb items

## Connection to Navigation Issues

This enhancement directly supports the **sticky explorer workflow** by:
- **Reducing context switching** between file and symbol navigation
- **Unifying path copying** across different navigation contexts
- **Maintaining consistent UX** with existing Snacks explorer patterns

## Technical Integration Points

### Reuse Existing Systems
- **Snacks picker `` binding**: Extend with context detection
- **Picker-extensions menu**: 8 path formats already implemented
- **Navic winbar display**: Breadcrumb visualization infrastructure
- **Tree-sitter statusline**: Hidden breadcrumb functionality discovered

### Zero Breaking Changes
- **Backward compatibility**: All existing Snacks explorer behavior preserved
- **Additive enhancement**: New functionality only activates in editor contexts
- **Consistent UX**: Same `` mental model across all navigation

## Success Metrics

✅ **Unified Experience**: Single `` keybinding works across all navigation contexts
✅ **Path Copy Efficiency**: 4+ symbol path formats available instantly
✅ **Context Awareness**: Smart detection between file/symbol/breadcrumb scenarios
✅ **Performance**: <50ms response time using cached tree-sitter data
✅ **Compatibility**: Zero impact on existing Snacks explorer workflows

## Files Affected

- `lua/plugins/navic.lua` - Extend with tree-sitter fallback
- `lua/utils/picker-extensions.lua` - Add symbol path formats
- `lua/config/keymaps.lua` - Unified `` context detection
- New: `lua/utils/breadcrumb-navigation.lua` - Context detection logic

## Priority: High
Critical for unified navigation workflow and developer productivity.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.