M1.13: watch open buffers' folders, bufferFocused, truncated tree row
- The parent directory of every open buffer is pinned in the project
watcher (workspace::sync_buffer_dirs after every command): it counts
against the cap but is never evicted while a buffer in it is open, so
reloads and fileChangedOnDisk arrive for never-expanded folders.
- file.open on an already-open buffer emits the new bufferFocused {id};
the editor activates that tab and it outranks pending adoptions.
- The project tree shows a "Listing truncated" note row
(project.tree.truncated) after a partly listed directory.
- Tests: engine (pinning, eviction, focus), control channel
(bufferFocused), Vitest (tab switch, race, truncated row).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7b7273a947
commit
8a71f7bd08
19 changed files with 312 additions and 30 deletions
|
|
@ -14,6 +14,7 @@ export type EditorEvent =
|
|||
| { kind: "projectOpened" }
|
||||
| { kind: "projectClosed" }
|
||||
| { kind: "bufferOpened"; id: number; path: string }
|
||||
| { kind: "bufferFocused"; id: number }
|
||||
| { kind: "bufferChanged"; id: number; version: number }
|
||||
| { kind: "dirtyChanged"; id: number; dirty: boolean }
|
||||
| { kind: "bufferClosed"; id: number }
|
||||
|
|
@ -41,6 +42,8 @@ export function toEditorEvent(payload: EngineEventPayload): EditorEvent | null {
|
|||
return id !== null && typeof raw.path === "string"
|
||||
? { kind: "bufferOpened", id, path: raw.path }
|
||||
: null;
|
||||
case "bufferFocused":
|
||||
return id !== null ? { kind: "bufferFocused", id } : null;
|
||||
case "bufferChanged": {
|
||||
const version = num("version");
|
||||
return id !== null && version !== null ? { kind: "bufferChanged", id, version } : null;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
* Keys: Up/Down move the selection, Home/End jump to the first/last row,
|
||||
* Right expands a folder or moves into it, Left collapses a folder or moves
|
||||
* to the parent, Enter opens a file or toggles a folder. Double-click does
|
||||
* the same as Enter. Ignored and excluded entries are dimmed.
|
||||
* the same as Enter. Ignored and excluded entries are dimmed. A directory
|
||||
* the engine listed only partly ends with a "listing truncated" note.
|
||||
*/
|
||||
import { ChevronDown, ChevronRight, File, FileCode, Folder, FolderOpen } from "@lucide/vue";
|
||||
import { computed, nextTick, ref } from "vue";
|
||||
|
|
@ -286,6 +287,14 @@ function onFocus(): void {
|
|||
>
|
||||
{{ t("project.tree.loading") }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="row.kind === 'truncated'"
|
||||
class="tree__row tree__row--note"
|
||||
:style="{ '--tree-depth': row.depth }"
|
||||
data-test="tree-truncated"
|
||||
>
|
||||
{{ t("project.tree.truncated") }}
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
class="tree__row tree__row--note tree__row--error"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue