Private
Public Access
0
0

docs(context-curation,shaders): add Structural File Editor (Phase 7) and NERV theme effects sections

This commit is contained in:
2026-06-02 19:21:13 -04:00
parent 959e7f30a3
commit 8444285d70
2 changed files with 60 additions and 0 deletions
+30
View File
@@ -271,3 +271,33 @@ uv run pytest tests/test_fuzzy_anchor.py tests/test_history_manager.py \
tests/test_ts_cpp_tools.py tests/test_ast_parser.py \
tests/test_phase6_simulation.py -v
```
---
## Structural File Editor (Phase 7)
Phase 7 unified two previously separate modals — the **AST Inspector** and the **Slice Editor** — into a single **Structural File Editor** modal. This reduces modal-switching overhead when curating context for a file with both AST-masked symbols and fuzzy-anchored slices.
### Unified Modal Flow
When the user clicks "Inspect" or "Slices" on a file item in the Context Panel:
1. The Structural File Editor modal opens with two side-by-side panes:
- **Left pane:** Hierarchical AST tree (using `ts_*_get_code_outline` for C/C++, `py_get_code_outline` for Python). Each node is a clickable target for AST masking.
- **Right pane:** Slice list with line ranges. Each slice can be edited, deleted, or converted to a fuzzy anchor.
2. Selecting a node in the left pane shows its current mask state (`full` / `def` / `sig` / `agg` / `hide`) and allows modification.
3. The slice list on the right updates in real time as fuzzy anchors are added or resolved.
### Key Files
- `src/gui_2.py:_render_structural_file_editor_modal` — The unified modal renderer.
- The previously separate `_render_ast_inspector_modal` and `_render_slice_editor_modal` functions are deprecated; their state is migrated to the unified editor on first open.
### Behavioral Equivalence
The unified editor preserves the behavior of both predecessors:
- All AST mask operations (set/clear state per symbol) work identically.
- Fuzzy anchor slice operations (create, resolve, annotate) work identically.
- The "Apply" action writes the modified `ast_mask` and slice list to the file item in a single transaction.
This is a UX consolidation, not a data model change. The underlying `ast_mask: dict[str, str]` and slice list structures are unchanged.