Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/architecture/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ src/

```mermaid
flowchart TB
accTitle: Workspace Wiki Extension Architecture
accDescr: Shows the relationships between the main modules - Extension activation, Scanner, Tree Provider, Controllers, Utilities, and the VS Code API they all interact with.
subgraph Extension["Extension (src/extension.ts)"]
A[activate]
B[Command Registration]
Expand Down Expand Up @@ -125,6 +127,8 @@ flowchart TB

```mermaid
sequenceDiagram
accTitle: Workspace Wiki Data Flow
accDescr: Shows the sequence from workspace open through extension activation, tree rendering, file click handling, and active-editor sync back to the user.
participant User
participant VSCode as VS Code
participant Extension
Expand Down
17 changes: 11 additions & 6 deletions docs/architecture/preview-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ The Preview/Open Controller is implemented in [`src/controllers/previewControlle

## Features

- Single-click: Opens file in preview mode.
- Double-click: Opens file in full editor mode.
- Single-click: Opens file in preview mode using the command configured in `workspaceWiki.openWith` (e.g., `markdown.showPreview` for `.md` files).
- Double-click: Opens file in full editor mode via `vscode.open`.
- Context menu: Additional actions (e.g., open to the side).
- Uses VS Code commands like `vscode.openWith` and `window.showTextDocument`.

## Double-Click Detection

Expand All @@ -30,7 +29,11 @@ const DOUBLE_CLICK_THRESHOLD = 500; // milliseconds
## Example

```ts
vscode.commands.executeCommand('vscode.openWith', uri, 'vscode.markdown.preview');
// Single click: opens via configured openWith command (e.g. markdown.showPreview)
openInPreview(uri);

// Double click: always opens in editor
openInEditor(uri); // executes vscode.open
```

## Customization
Expand All @@ -44,6 +47,8 @@ See also: [Settings Manager](./settings.md)

```mermaid
sequenceDiagram
accTitle: File Open Double-Click Detection Flow
accDescr: Shows how a user click on a tree item is handled - single clicks (gap >= 500ms since last click) open the file in preview mode, while double clicks (gap < 500ms) open the file in the editor.
participant User as User
participant Tree as Tree View
participant Handler as handleFileClick
Expand All @@ -52,10 +57,10 @@ sequenceDiagram
Tree->>Handler: Trigger Click Handler
activate Handler
Handler->>Handler: Check Click Time
alt Single Click (< 500ms)
alt Single Click (>= 500ms since last click)
Handler->>Command: Execute Default Command
Command->>User: Open Preview
else Double Click (< 500ms apart)
else Double Click (< 500ms since last click)
Handler->>Command: Execute vscode.open
Command->>User: Open in Editor
end
Expand Down
2 changes: 2 additions & 0 deletions docs/architecture/scanner.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ See also: [Settings Manager](./settings.md)

```mermaid
flowchart TD
accTitle: Scanner File Discovery Flow
accDescr: Shows the scanning process: reading configuration, building exclude patterns (including .gitignore), running findFiles for each supported extension, then applying hidden-file, exclude-pattern, and depth filters before returning results.
A[Start Scan] --> B[Read Config]
B -->|Get supportedExtensions| C[Set Extension Patterns]
B -->|Get excludeGlobs| D[Set Exclude Patterns]
Expand Down
2 changes: 2 additions & 0 deletions docs/architecture/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ See also: [Usage/Setup](../usage/setup.md)

```mermaid
flowchart TD
accTitle: Settings Application Flow
accDescr: Shows how user settings flow from VS Code Settings through the Settings Manager and are applied to each module - Scanner, TreeDataProvider, Preview Controller, and Sync Module.
A[User] -->|Updates Settings| B[VS Code Settings]
B -->|Read by| C[Settings Manager]
C -->|Applies to| D[Scanner/Indexer]
Expand Down
2 changes: 2 additions & 0 deletions docs/architecture/sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ See also: [Tree Data Provider](./tree-data-provider.md), [Settings](./settings.m

```mermaid
sequenceDiagram
accTitle: Sync Module Active File Revelation Sequence
accDescr: Shows the sequence for auto-revealing the active file in the tree - the editor change listener reads autoReveal and autoRevealDelay settings, optionally waits, looks up the node by path, and calls treeView.reveal if the tree is visible.
participant VSCode as VS Code Editor
participant Listener as Editor Change Listener
participant Config as Config Manager
Expand Down
11 changes: 2 additions & 9 deletions docs/architecture/tree-data-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ The TreeDataProvider module powers the Workspace Wiki sidebar tree, converting f

The TreeDataProvider is implemented in [`src/tree/treeProvider.ts`](../../src/tree/treeProvider.ts) as the `WorkspaceWikiTreeProvider` class, along with the `buildTree()` helper function in [`src/tree/buildTree.ts`](../../src/tree/buildTree.ts). The TreeNode interface is defined in [`src/types/treeNode.ts`](../../src/types/treeNode.ts).

## Architecture Changes

**Recent Improvements:**

- **Modular Structure**: TreeDataProvider moved from `src/extension.ts` to dedicated `src/tree/` module
- **Type Organization**: `TreeNode` interface moved to `src/types/` for better type organization
- **Path Imports**: Updated to support `@tree` imports via index.ts for cleaner imports
- **Comprehensive Testing**: Added full unit test coverage for all tree functionality

## Responsibilities

- Implements VS Code's `TreeDataProvider` interface.
Expand Down Expand Up @@ -95,6 +86,8 @@ See also: [Scanner/Indexer](./scanner.md)

```mermaid
flowchart TD
accTitle: Tree Node Ordering Logic
accDescr: Shows how tree nodes are sorted - README nodes always rank first, then root-level nodes are ordered by the directorySort setting (files-first, folders-first, or alphabetical), and finally alphabetically by title within each group. Folder nodes use index.md for their name when present.
A[All Nodes] --> B{Is README?}
B -->|Yes| C[Rank First]
B -->|No| D{Root Level?}
Expand Down
2 changes: 2 additions & 0 deletions docs/usage/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ test('Workspace Wiki tree appears', async () => {

```mermaid
sequenceDiagram
accTitle: Test Execution Flow
accDescr: Shows the two test execution paths - running npm run test:jest launches Jest for unit tests, and npm run test:extension launches a VS Code instance for E2E tests.
participant Dev as Developer
participant CLI as Command Line
participant Jest as Jest Runner
Expand Down
Loading
Loading