Skip to content

feat: Allowed Directories management panel#23

Closed
Copilot wants to merge 5 commits into
mainfrom
copilot/feature-allowed-directories-panel
Closed

feat: Allowed Directories management panel#23
Copilot wants to merge 5 commits into
mainfrom
copilot/feature-allowed-directories-panel

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 24, 2026

GridWatch had no UI for managing the Copilot agent's allowed-directories list. This adds a dedicated DIRS page with full CRUD, search, auto-refresh, and security hardening consistent with the MCP/LSP pages.

Storage

Persists to ~/.copilot/gridwatch-allowed-dirs.json:

{ "directories": [{ "path": "/absolute/path", "addedAt": "2024-01-01T00:00:00.000Z" }] }

IPC surface (electron/main.ts + preload.ts)

  • dirs:get-all — returns AllowedDirectory[] with live exists flag; 10 s in-memory cache
  • dirs:add — opens native folder-picker dialog, validates, appends, invalidates cache
  • dirs:remove — validates path, removes entry, deletes file when list becomes empty
  • app:open-item-folder extended with 'dirs' case → reveals config file in Finder/Explorer

Security

  • Prototype pollution guard (PROTOTYPE_POLLUTION_KEYS)
  • Shell metacharacter blocklist (; | & \ $ ( ) > < \0 %`)
  • Absolute-path enforcement + explicit .. segment check (cross-platform, splits on both / and \)
  • 4096-char max path length
  • isValidDirPath applied inside readAllowedDirs so tampered JSON can't inject invalid paths
  • fs.statSync confirms selection is a directory before persisting

UI (DirsPage.tsx / DirsPage.module.css)

  • List/detail split layout consistent with Skills, MCP, LSP, Agents pages
  • ⊟ DIRS nav entry added after AGENTS
  • EXISTS / NOT FOUND badges; error banner with dismiss (including openItemFolder failures)
  • 30 s auto-refresh interval + refreshKey prop; + ADD button triggers folder-picker

Copilot AI linked an issue Apr 24, 2026 that may be closed by this pull request
8 tasks
Copilot AI and others added 3 commits April 24, 2026 16:40
Copilot AI changed the title [WIP] Add management panel for allowed directories configuration feat: Allowed Directories management panel Apr 24, 2026
Copilot AI requested a review from faesel April 24, 2026 16:45
@faesel
Copy link
Copy Markdown
Owner

faesel commented May 3, 2026

Closed — branch merged directly to main in v0.31.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Allowed directories management panel

2 participants