Directory structure:
└── project-dashboard/
    ├── README.md
    ├── CHANGELOG.md
    ├── LICENSE
    ├── package.json
    ├── tsconfig.json
    └── src/
        ├── DashboardProvider.ts
        ├── extension.ts
        ├── models.ts
        ├── ProjectRegistry.ts
        ├── ProjectTreeDataProvider.ts
        └── utils.ts

================================================
FILE: README.md
================================================
# Project Dashboard

A lightweight VS Code extension for managing your frequently used workspaces and projects from a polished dashboard and an integrated sidebar.

## Features

- Project dashboard with pinned, recent, and all project views
- Sidebar tree view organized by pinned status, categories, and languages
- Edit project metadata such as name, category, language, and card color
- Pin/unpin projects for quick access
- Add and remove projects manually
- Register the current folder as a project directly from VS Code
- Light/dark theme-friendly dynamic UI

## Screenshots

### Dashboard

![Dashboard - Dark Mode](media/screenshots/Dashboard_Dark.png)

![Dashboard - Light Mode](media/screenshots/Dashboard_Light.png)

### Colored cards and dialog

![Dashboard with Project Colors](media/screenshots/Dashboard_Dark_Color.png)

![Edit Project Dialog](media/screenshots/Dialog_Light.png)

### Sidebar project tree

![Sidebar Tree - Dark Mode](media/screenshots/Tree_Dark.png)

![Sidebar Tree - Light Mode](media/screenshots/Tree_Light.png)

## Installation

1. `npm install`
2. `npm run compile`
3. Press `F5` to launch the extension in the Extension Development Host

## Usage

Open the command palette and run any of the following commands:

- `Projects: Open Dashboard`
- `Projects: Add Project`
- `Projects: Pin/Unpin Project`
- `Projects: Set Category`
- `Projects: Set Language`
- `Projects: Remove Project`
- `Projects: Register Current Folder`

## Recommended workflow

1. Open the dashboard via `Projects: Open Dashboard`
2. Add or register your current workspace
3. Pin your most important projects for easy access
4. Organize projects with categories and languages
5. Use the sidebar to browse pinned, recent, and grouped projects

## Development

- Built with TypeScript
- Uses VS Code extension APIs for custom views and Webview UI

## License

See [LICENSE](/LICENSE) for license details.



================================================
FILE: CHANGELOG.md
================================================
# Changelog

All notable changes to this project will be documented in this file.

## [0.1.0] - 2026-06-02

### Added

* Project Dashboard Colors
* Added Screenshots

### Changed

* Improved Dashboard UI
* Improved Tree View
* Improved README.md



================================================
FILE: LICENSE
================================================

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright 2026 Govind Sankar

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: package.json
================================================
{
  "name": "project-dashboard",
  "displayName": "Project Dashboard",
  "description": "A fast, theme-aware startup dashboard and sidebar project manager.",
  "version": "0.1.0",
  "publisher": "govind-sankar",
  "engines": {
    "vscode": "^1.76.0"
  },
  "categories": [
    "Other",
    "Visualization"
  ],
  "author": {
    "name": "Govind Sankar",
    "url": "https://github.com/govind-sankar"
  },
  "license": "Apache-2.0",
  "keywords": [
    "vscode",
    "projects",
    "dashboard",
    "workspace",
    "project-manager",
    "sidebar"
  ],
  "icon": "media/icon-bg.png",
  "repository": {
    "type": "git",
    "url": "https://github.com/govind-sankar/project-dashboard.git"
  },
  "homepage": "https://github.com/govind-sankar/project-dashboard",
  "bugs": {
    "url": "https://github.com/govind-sankar/project-dashboard/issues"
  },
  "activationEvents": [
    "*",
    "onCommand:projectDashboard.openDashboard",
    "onCommand:projectDashboard.refresh",
    "onView:projectDashboard.projectsView"
  ],
  "main": "./out/extension.js",
  "contributes": {
    "commands": [
      {
        "command": "projectDashboard.openDashboard",
        "title": "Projects: Open Dashboard"
      },
      {
        "command": "projectDashboard.addProject",
        "title": "Projects: Add Project"
      },
      {
        "command": "projectDashboard.pinToggle",
        "title": "Projects: Pin/Unpin Project"
      },
      {
        "command": "projectDashboard.setCategory",
        "title": "Projects: Set Category"
      },
      {
        "command": "projectDashboard.setLanguage",
        "title": "Projects: Set Language"
      },
      {
        "command": "projectDashboard.removeProject",
        "title": "Projects: Remove Project"
      },
      {
        "command": "projectDashboard.refresh",
        "title": "Projects: Refresh"
      },
      {
        "command": "projectDashboard.registerCurrent",
        "title": "Projects: Register Current Folder"
      }
    ],
    "viewsContainers": {
      "activitybar": [
        {
          "id": "projectDashboard",
          "title": "Projects",
          "icon": "media/icon.svg"
        }
      ]
    },
    "views": {
      "projectDashboard": [
        {
          "id": "projectDashboard.projectsView",
          "name": "Projects",
          "icon": "media/icon.svg"
        }
      ]
    }
  },
  "scripts": {
    "vscode:prepublish": "npm run compile",
    "compile": "tsc -p ./",
    "watch": "tsc -watch -p ./"
  },
  "devDependencies": {
    "typescript": "^4.9.5",
    "@types/node": "^18.0.0",
    "@types/vscode": "^1.76.0"
  }
}



================================================
FILE: tsconfig.json
================================================
{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es2020",
    "outDir": "out",
    "rootDir": "src",
    "sourceMap": true,
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  },
  "exclude": ["node_modules", ".vscode-test"]
}



================================================
FILE: src/DashboardProvider.ts
================================================
import * as vscode from "vscode";
import { ProjectRegistry } from "./ProjectRegistry";
import { ProjectEntry } from "./models";

export class DashboardProvider {
  private panel: vscode.WebviewPanel | null = null;
  private ctx: vscode.ExtensionContext;
  private registry: ProjectRegistry;
  private onChanged?: () => void;

  constructor(
    context: vscode.ExtensionContext,
    registry: ProjectRegistry,
    onChanged?: () => void,
  ) {
    this.ctx = context;
    this.registry = registry;
    this.onChanged = onChanged;
  }

  public show() {
    if (this.panel) {
      this.panel.reveal(vscode.ViewColumn.One);
      return;
    }
    this.panel = vscode.window.createWebviewPanel(
      "projectDashboard",
      "Project Dashboard",
      vscode.ViewColumn.One,
      {
        enableScripts: true,
        retainContextWhenHidden: true,
      },
    );
    this.panel.webview.html = this.getHtml();
    this.panel.webview.onDidReceiveMessage(this.onMessage.bind(this));
    this.panel.onDidDispose(() => {
      this.panel = null;
    });
  }

  private postProjects() {
    if (!this.panel) return;
    const data = this.registry.getAll();
    this.panel.webview.postMessage({ type: "projects", data });
  }

  private onMessage(msg: any) {
    switch (msg.command) {
      case "ready":
        this.postProjects();
        break;
      case "open":
        this.openProject(msg.path);
        break;
      case "add":
        this.addProjectFromDialog();
        break;
      case "refresh":
        this.postProjects();
        break;
      case "pinToggle":
        this.registry.pinToggle(msg.path);
        this.onChanged?.();
        this.postProjects();
        break;
      case "updateProject":
        try {
          this.registry.updateProject(msg.originalPath, {
            name: msg.name,
            path: msg.path,
            category: msg.category,
            language: msg.language,
            color: msg.color,
            pinned: msg.pinned,
          });
          this.onChanged?.();
          this.postProjects();
        } catch (e) {
          vscode.window.showErrorMessage(
            "Failed to update project: " + String(e),
          );
        }
        break;
    }
  }

  public async addProjectFromDialog() {
    const uri = await vscode.window.showOpenDialog({
      canSelectFolders: true,
      canSelectFiles: true,
      canSelectMany: false,
      openLabel: "Select Project Folder or .code-workspace",
    });
    if (!uri || uri.length === 0) return;
    const p = uri[0].fsPath;
    this.registry.add({ path: p, name: undefined });
    this.postProjects();
  }

  private async openProject(path: string) {
    try {
      await vscode.commands.executeCommand(
        "vscode.openFolder",
        vscode.Uri.file(path),
        false,
      );
      this.registry.touchOpened(path);
    } catch (e) {
      vscode.window.showErrorMessage("Failed to open project: " + String(e));
    }
  }

  private getHtml() {
    const webview = this.ctx.extensionUri;
    const nonce = Date.now().toString(36);

    return `<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline' vscode-resource:; script-src 'nonce-${nonce}';">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Project Dashboard</title>
  <style>
    :root { color: var(--vscode-foreground); background: var(--vscode-editor-background); accent: var(--vscode-button-primaryBackground); }
    body { font-family: var(--vscode-font-family); color: var(--vscode-foreground); background: var(--vscode-editor-background); margin: 10px; padding: 16px; }
    .header { display:flex; align-items:center; gap:12px; margin: 4px 0px;}
    .search-section { display:flex; align-items:center; gap:12px; }
    input.search { flex:1; padding:10px 16px; border-radius:6px; border:1px solid var(--vscode-input-border); background:var(--vscode-input-background); color:var(--vscode-input-foreground); }
    .section { margin-top:16px; }
    .btn { padding: 10px 16px; border: none; border-radius: 4px; cursor: pointer; background: var(--vscode-button-background); color: var(--vscode-button-foreground); }
    .btn:hover { background: var(--vscode-button-hoverBackground); }
    .grid { display: flex; gap:12px; flex-wrap:wrap; }
    .card { position: relative; padding:12px; border-radius:6px; background:var(--vscode-sideBar-background); min-width:200px; cursor:pointer; padding-right: 42px; }
    .card .small { font-size:0.9em; color: inherit; margin-top: 6px; }
    .edit-btn { position: absolute; top: 32px; right: 6px; width: 24px; height: 24px; border: none; border-radius: 4px; cursor: pointer; background: transparent; color: currentColor; display: inline-flex; align-items: center; justify-content: center; opacity: 0.75; padding: 0; }
    .edit-btn:hover { opacity: 1; background: var(--vscode-toolbar-hoverBackground); }
    .edit-btn svg { width: 14px; height: 14px; fill: currentColor; display: block; }
    .modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: none; align-items: center; justify-content: center; z-index: 1000; }
    .modal { width: min(92vw, 440px); border-radius: 10px; border: 1px solid var(--vscode-panel-border); background: var(--vscode-editor-background); padding: 16px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); }
    .background-btn { position: fixed; right: 20px; bottom: 20px; z-index: 100; }
    .modal h3 { margin: 0 0 12px 0; }
    .form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
    .form-row label { font-size: 0.9em; color: var(--vscode-descriptionForeground); }
    .modal input[type="text"], .modal select { padding: 8px 10px; border-radius: 6px; border: 1px solid var(--vscode-input-border); background: var(--vscode-input-background); color: var(--vscode-input-foreground); }
    .check-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; margin-bottom: 8px; color: var(--vscode-foreground); }
    .pin-btn { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: none; border-radius: 4px; cursor: pointer; background: transparent; color: currentColor; display: inline-flex; align-items: center; justify-content: center; opacity: 0.75; padding: 0; }
    .pin-btn:hover { opacity: 1; background: var(--vscode-toolbar-hoverBackground); }
    .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
  </style>
</head>
<body>

  <div class="header">
    <h1>Project Dashboard</h1>
  </div>

  <div class="search-section">
    <input id="search" class="search" placeholder="Search projects..." />
    <button id="add" class="btn">Add</button>
  </div>

  <div class="section">
    <h3>Pinned</h3>
    <div id="pinned" class="grid"></div>
  </div>

  <div class="section">
    <h3>Recent</h3>
    <div id="recent" class="grid"></div>
  </div>

  <div class="section">
    <h3>All</h3>
    <div id="all" class="grid"></div>
  </div>

  <!-- <button id="backgroundButton" class="btn background-btn" type="button">Dashboard Background</button> -->

  <div id="editBackdrop" class="modal-backdrop">
    <div class="modal" role="dialog" aria-modal="true" aria-labelledby="editTitle">
      <h3 id="editTitle">Edit Project</h3>

      <div class="form-row">
        <label for="editName">Name</label>
        <input id="editName" type="text" />
      </div>

      <div class="form-row">
        <label for="editPath">Folder / Path</label>
        <input id="editPath" type="text" />
      </div>

      <div class="form-row">
        <label for="editCategory">Category</label>
        <input id="editCategory" type="text" list="category-options" placeholder="Select or type a category" />
      </div>

      <div class="form-row">
        <label for="editLanguage">Language</label>
        <input id="editLanguage" type="text" list="language-options" placeholder="Select or type a language" />
      </div>

      <div class="form-row">
        <label for="editColor">Card color</label>
        <select id="editColor">
          <option value="default">Default (theme dependent)</option>
          <option value="teal">Teal</option>
          <option value="blue">Blue</option>
          <option value="purple">Purple</option>
          <option value="magenta">Magenta</option>
          <option value="orange">Orange</option>
          <option value="green">Green</option>
          <option value="yellow">Yellow</option>
          <option value="slate">Slate</option>
        </select>
      </div>

      <datalist id="category-options">
        <option value="Web"></option>
        <option value="Mobile"></option>
        <option value="Library"></option>
        <option value="Tooling"></option>
        <option value="Infrastructure"></option>
        <option value="Research"></option>
        <option value="Experimental"></option>
      </datalist>

      <datalist id="language-options">
        <option value="JavaScript"></option>
        <option value="TypeScript"></option>
        <option value="Python"></option>
        <option value="Java"></option>
        <option value="C#"></option>
        <option value="Go"></option>
        <option value="Rust"></option>
        <option value="Ruby"></option>
      </datalist>

      <label class="check-row">
        <input id="editPinned" type="checkbox" />
        <span>Pinned</span>
      </label>

      <div class="modal-actions">
        <button id="cancelEdit" class="btn" type="button">Cancel</button>
        <button id="saveEdit" class="btn" type="button">Save</button>
      </div>
    </div>
  </div>

  <div id="bgBackdrop" class="modal-backdrop">
    <div class="modal" role="dialog" aria-modal="true" aria-labelledby="bgTitle">
      <h3 id="bgTitle">Dashboard Background</h3>
      <div class="form-row">
        <label for="bgColor">Background color</label>
        <select id="bgColor">
          <option value="default">Default (theme dependent)</option>
          <option value="teal">Teal</option>
          <option value="blue">Blue</option>
          <option value="purple">Purple</option>
          <option value="magenta">Magenta</option>
          <option value="orange">Orange</option>
          <option value="green">Green</option>
          <option value="yellow">Yellow</option>
          <option value="slate">Slate</option>
        </select>
      </div>
      <div class="form-row">
        <label for="bgImageUrl">Background image URL</label>
        <input id="bgImageUrl" type="text" placeholder="https://example.com/image.jpg" />
      </div>
      <div class="form-row">
        <label for="bgImageFile">Upload local image</label>
        <input id="bgImageFile" type="file" accept="image/*" />
      </div>
      <div class="modal-actions">
        <button id="cancelBg" class="btn" type="button">Cancel</button>
        <button id="saveBg" class="btn" type="button">Save</button>
      </div>
    </div>
  </div>

  <script nonce="${nonce}">
    const vscode = acquireVsCodeApi();
    const projects = [];
    const elPinned = document.getElementById('pinned');
    const elRecent = document.getElementById('recent');
    const elAll = document.getElementById('all');
    const search = document.getElementById('search');

    const editBackdrop = document.getElementById('editBackdrop');
    const editName = document.getElementById('editName');
    const editPath = document.getElementById('editPath');
    const editCategory = document.getElementById('editCategory');
    const editLanguage = document.getElementById('editLanguage');
    const editColor = document.getElementById('editColor');
    const editPinned = document.getElementById('editPinned');
    const cancelEdit = document.getElementById('cancelEdit');
    const saveEdit = document.getElementById('saveEdit');

    const backgroundButton = document.getElementById('backgroundButton');
    const bgBackdrop = document.getElementById('bgBackdrop');
    const bgColor = document.getElementById('bgColor');
    const bgImageUrl = document.getElementById('bgImageUrl');
    const bgImageFile = document.getElementById('bgImageFile');
    const cancelBg = document.getElementById('cancelBg');
    const saveBg = document.getElementById('saveBg');

    const colorMap = {
      default: 'var(--vscode-sideBar-background)',
      teal: '#62c2a9',
      blue: '#7faeff',
      purple: '#b084ff',
      magenta: '#f06292',
      orange: '#ffaf5b',
      green: '#7bc86f',
      yellow: '#f6ce5e',
      slate: '#95a3b8'
    };

    const darkTextColors = new Set(['teal', 'blue', 'purple', 'orange', 'green', 'yellow', 'slate']);
    const dashboardTextColor = {
      default: 'var(--vscode-foreground)',
      teal: '#000',
      blue: '#fff',
      purple: '#fff',
      magenta: '#fff',
      orange: '#000',
      green: '#000',
      yellow: '#000',
      slate: '#fff'
    };

    let editingProject = null;
    let currentDashboardColor = 'default';
    let currentDashboardImage = '';

    function applyDashboardBackground() {
      const baseBg = currentDashboardColor === 'default' ? 'var(--vscode-editor-background)' : colorMap[currentDashboardColor] || currentDashboardColor;
      const text = currentDashboardImage ? 'var(--vscode-foreground)' : (dashboardTextColor[currentDashboardColor] || 'var(--vscode-foreground)');
      const bgValue = currentDashboardImage
        ? baseBg + " url('" + currentDashboardImage + "') center/cover no-repeat"
        : baseBg;
      document.body.style.background = bgValue;
      document.body.style.color = text;
      document.querySelectorAll('.header h1, .form-row label, .modal input, .modal select').forEach(el => {
        el.style.color = text;
      });
      if (bgBackdrop) bgBackdrop.style.background = 'rgba(0, 0, 0, 0.45)';
    }

    function setDashboardBackground(color) {
      currentDashboardColor = color;
      currentDashboardImage = '';
      applyDashboardBackground();
    }

    function setDashboardImage(imageUrl) {
      currentDashboardImage = imageUrl || '';
      applyDashboardBackground();
    }

    document.getElementById('add').addEventListener('click', ()=>vscode.postMessage({command:'add'}));
    search.addEventListener('input', ()=>render());

    backgroundButton?.addEventListener('click', () => {
      if (bgColor) bgColor.value = currentDashboardColor;
      if (bgImageUrl) bgImageUrl.value = currentDashboardImage || '';
      if (bgBackdrop) bgBackdrop.style.display = 'flex';
    });

    cancelEdit.addEventListener('click', closeEditModal);
    saveEdit.addEventListener('click', saveEditModal);

    cancelBg?.addEventListener('click', () => {
      if (bgBackdrop) bgBackdrop.style.display = 'none';
    });
    saveBg?.addEventListener('click', () => {
      const selectedColor = bgColor ? bgColor.value : 'default';
      const imageUrl = bgImageUrl ? bgImageUrl.value.trim() : '';
      if (imageUrl) {
        setDashboardImage(imageUrl);
      } else {
        setDashboardBackground(selectedColor);
      }
      if (bgBackdrop) bgBackdrop.style.display = 'none';
    });

    editBackdrop.addEventListener('click', (e) => {
      if (e.target === editBackdrop) {
        closeEditModal();
      }
    });
    bgBackdrop?.addEventListener('click', (e) => {
      if (e.target === bgBackdrop) {
        if (bgBackdrop) bgBackdrop.style.display = 'none';
      }
    });

    bgImageFile?.addEventListener('change', (event) => {
      const file = event.target.files && event.target.files[0];
      if (!file) return;
      const reader = new FileReader();
      reader.onload = () => {
        if (typeof reader.result === 'string') {
          if (bgImageUrl) bgImageUrl.value = reader.result;
          setDashboardImage(reader.result);
        }
      };
      reader.readAsDataURL(file);
    });

    window.addEventListener('keydown', (e) => {
      if (e.key === 'Escape') {
        if (editBackdrop.style.display === 'flex') {
          closeEditModal();
        }
        if (bgBackdrop?.style.display === 'flex') {
          if (bgBackdrop) bgBackdrop.style.display = 'none';
        }
      }
      if (e.key === 'Enter' && editBackdrop.style.display === 'flex') {
        const activeTag = document.activeElement && document.activeElement.tagName;
        if (activeTag !== 'TEXTAREA') {
          saveEditModal();
        }
      }
    });

    window.addEventListener('message', event=>{
      const msg = event.data;
      if (msg.type === 'projects') {
        projects.length = 0;
        msg.data.forEach(p=>projects.push(p));
        render();
      }
    });

    function render() {
      const q = search.value.toLowerCase();
      const filtered = projects.filter(p=>{
        return [p.name, p.path, p.category || '', p.language || '', (p.tags||[]).join(' ')].join(' ').toLowerCase().includes(q);
      });
      renderGrid(elPinned, filtered.filter(p=>p.pinned));
      renderGrid(elRecent, filtered.slice().sort((a,b)=>(b.lastOpened||0)-(a.lastOpened||0)).slice(0,4));
      renderGrid(elAll, filtered);
    }

    function renderGrid(container, list) {
      container.innerHTML = '';
      if (!list.length) { container.innerHTML = '<div class="small">(empty)</div>'; return; }

      list.forEach(p=>{
        const d = document.createElement('div');
        d.className = 'card';

        const title = document.createElement('div');
        const strong = document.createElement('strong');
        strong.textContent = p.name || '';
        title.appendChild(strong);

        const pathLine = document.createElement('div');
        pathLine.className = 'small';
        pathLine.textContent = p.path || '';

        const edit = document.createElement('button');
        edit.className = 'edit-btn';
        edit.type = 'button';
        edit.title = 'Edit project';
        edit.setAttribute('aria-label', 'Edit project');
        edit.innerHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zm2.92 2.33H5v-.92l9.06-9.06.92.92L5.92 19.58zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';

        edit.onclick = (e) => {
          e.stopPropagation();
          openEditModal(p);
        };

        const pin = document.createElement('button');
        pin.className = 'pin-btn';
        pin.type = 'button';
        pin.title = p.pinned ? 'Unpin project' : 'Pin project';
        pin.setAttribute('aria-label', p.pinned ? 'Unpin project' : 'Pin project');
        pin.innerHTML = p.pinned ? 'â˜…' : 'â˜†';

        pin.onclick = (e) => {
          e.stopPropagation();
          vscode.postMessage({ command: 'pinToggle', path: p.path });
        };

        d.appendChild(pin);
        d.appendChild(edit);
        d.appendChild(title);
        d.appendChild(pathLine);

        if (p.category || p.language) {
          const metaLine = document.createElement('div');
          metaLine.className = 'small';
          const parts = [];
          if (p.category) parts.push(p.category);
          if (p.language) parts.push(p.language);
          metaLine.textContent = parts.join(' â€¢ ');
          d.appendChild(metaLine);
        }

        if (p.color && p.color !== 'default') {
          const bg = colorMap[p.color] || p.color;
          d.style.background = bg;
          d.style.color = darkTextColors.has(p.color) ? '#000' : '#fff';
        }

        d.onclick = ()=>vscode.postMessage({command:'open', path:p.path});
        container.appendChild(d);
      });
    }

    function openEditModal(project) {
      editingProject = project;
      editName.value = project.name || '';
      editPath.value = project.path || '';
      editCategory.value = project.category || '';
      editLanguage.value = project.language || '';
      editColor.value = project.color || 'default';
      editPinned.checked = !!project.pinned;
      editBackdrop.style.display = 'flex';
      setTimeout(() => editName.focus(), 0);
      editName.select();
    }

    function closeEditModal() {
      editingProject = null;
      editBackdrop.style.display = 'none';
    }

    function saveEditModal() {
      if (!editingProject) return;

      vscode.postMessage({
        command: 'updateProject',
        originalPath: editingProject.path,
        name: editName.value,
        path: editPath.value,
        category: editCategory.value,
        language: editLanguage.value,
        color: editColor.value,
        pinned: editPinned.checked
      });

      closeEditModal();
    }

    setDashboardBackground(currentDashboardColor);
    vscode.postMessage({command:'ready'});
  </script>
</body>
</html>`;
  }
}



================================================
FILE: src/extension.ts
================================================
import * as vscode from 'vscode';
import { ProjectRegistry } from './ProjectRegistry';
import { ProjectTreeDataProvider } from './ProjectTreeDataProvider';
import { DashboardProvider } from './DashboardProvider';

export function activate(context: vscode.ExtensionContext) {
  const registry = new ProjectRegistry(context);

  const treeProvider = new ProjectTreeDataProvider(registry);
  context.subscriptions.push(vscode.window.registerTreeDataProvider('projectDashboard.projectsView', treeProvider));

  const dashboard = new DashboardProvider(context, registry, ()=>treeProvider.refresh());

  context.subscriptions.push(vscode.commands.registerCommand('projectDashboard.openDashboard', ()=>dashboard.show()));

  context.subscriptions.push(vscode.commands.registerCommand('projectDashboard.refresh', ()=>treeProvider.refresh()));

  context.subscriptions.push(vscode.commands.registerCommand('projectDashboard.addProject', async ()=>{
    await dashboard.addProjectFromDialog?.();
    treeProvider.refresh();
  }));

  context.subscriptions.push(vscode.commands.registerCommand('projectDashboard.openProjectFromTree', async (path: string)=>{
    try {
      await vscode.commands.executeCommand('vscode.openFolder', vscode.Uri.file(path), true);
      registry.touchOpened(path);
    } catch (e) {
      vscode.window.showErrorMessage('Failed to open: '+String(e));
    }
  }));

  context.subscriptions.push(vscode.commands.registerCommand('projectDashboard.pinToggle', async (itemPath?: string)=>{
    if (!itemPath) {
      const pick = await vscode.window.showInputBox({ prompt: 'Project path to toggle pin' });
      if (!pick) return;
      itemPath = pick;
    }
    registry.pinToggle(itemPath);
    treeProvider.refresh();
  }));

  context.subscriptions.push(vscode.commands.registerCommand('projectDashboard.setCategory', async (path?: string)=>{
    const target = path || await vscode.window.showInputBox({ prompt: 'Project path to set category' }) || '';
    if (!target) return;
    const cat = await vscode.window.showInputBox({ prompt: 'Category' }) || '';
    registry.setCategory(target, cat);
    treeProvider.refresh();
  }));

  context.subscriptions.push(vscode.commands.registerCommand('projectDashboard.setLanguage', async (path?: string)=>{
    const target = path || await vscode.window.showInputBox({ prompt: 'Project path to set language' }) || '';
    if (!target) return;
    const lang = await vscode.window.showInputBox({ prompt: 'Language' }) || '';
    registry.setLanguage(target, lang);
    treeProvider.refresh();
  }));

  context.subscriptions.push(vscode.commands.registerCommand('projectDashboard.removeProject', async (path?: string)=>{
    const target = path || await vscode.window.showInputBox({ prompt: 'Project path to remove' }) || '';
    if (!target) return;
    registry.remove(target);
    treeProvider.refresh();
  }));

  context.subscriptions.push(vscode.commands.registerCommand('projectDashboard.registerCurrent', async ()=>{
    const folders = vscode.workspace.workspaceFolders;
    if (!folders || folders.length === 0) {
      vscode.window.showInformationMessage('No folder is open in the current window');
      return;
    }
    const p = folders[0].uri.fsPath;
    registry.add({ path: p, name: undefined });
    treeProvider.refresh();
    vscode.window.showInformationMessage('Registered current folder as project');
  }));

  if ((!vscode.workspace.workspaceFolders || vscode.workspace.workspaceFolders.length === 0) && !vscode.workspace.name) {
    dashboard.show();
  }
}

export function deactivate() {}



================================================
FILE: src/models.ts
================================================
import * as vscode from 'vscode';

export interface ProjectEntry {
  id: string;
  name: string;
  path: string;
  category?: string;
  language?: string;
  color?: string;
  pinned?: boolean;
  lastOpened?: number;
  tags?: string[];
}

export type ProjectFilter = (p: ProjectEntry) => boolean;



================================================
FILE: src/ProjectRegistry.ts
================================================
import * as vscode from 'vscode';
import { ProjectEntry } from './models';
import { now, safeNameFromPath } from './utils';

const STORAGE_KEY = 'projectDashboard.registry.v1';

export class ProjectRegistry {
  private ctx: vscode.ExtensionContext;
  private cache: ProjectEntry[] | null = null;

  constructor(context: vscode.ExtensionContext) {
    this.ctx = context;
  }

  private load(): ProjectEntry[] {
    if (this.cache) return this.cache;
    const raw = this.ctx.globalState.get<string>(STORAGE_KEY, '[]');
    try {
      const parsed = JSON.parse(raw) as ProjectEntry[];
      this.cache = parsed || [];
    } catch (e) {
      this.cache = [];
    }
    return this.cache;
  }

  private save() {
    const toSave = JSON.stringify(this.load());
    this.ctx.globalState.update(STORAGE_KEY, toSave);
  }

  public getAll(): ProjectEntry[] {
    return this.load().slice();
  }

  public findByPath(p: string) {
    return this.load().find(x => x.path === p);
  }

  public add(project: Partial<ProjectEntry>) {
    const list = this.load();
    if (!project.path) throw new Error('Project must have path');
    let existing = this.findByPath(project.path);
    if (existing) {
      existing = Object.assign(existing, project);
    } else {
      const id = Math.random().toString(36).slice(2, 9);
      const entry: ProjectEntry = {
        id,
        name: project.name || safeNameFromPath(project.path),
        path: project.path,
        category: project.category || '',
        language: project.language || '',
        color: project.color || 'default',
        pinned: !!project.pinned,
        lastOpened: project.lastOpened || 0,
        tags: project.tags || []
      };
      list.push(entry);
    }
    this.save();
  }

  public remove(path: string) {
    const list = this.load();
    const idx = list.findIndex(x => x.path === path);
    if (idx >= 0) {
      list.splice(idx, 1);
      this.save();
    }
  }

  public pinToggle(path: string) {
    const p = this.findByPath(path);
    if (!p) return;
    p.pinned = !p.pinned;
    this.save();
  }

  public setCategory(path: string, category: string) {
    const p = this.findByPath(path);
    if (!p) return;
    p.category = category;
    this.save();
  }

  public setLanguage(path: string, language: string) {
    const p = this.findByPath(path);
    if (!p) return;
    p.language = language;
    this.save();
  }

  public touchOpened(path: string) {
    const p = this.findByPath(path);
    if (!p) return;
    p.lastOpened = now();
    this.save();
  }

  public getPinned(): ProjectEntry[] {
    return this.getAll().filter(p => p.pinned).sort((a,b)=> (b.lastOpened||0)-(a.lastOpened||0));
  }

  public getRecent(limit = 20): ProjectEntry[] {
    return this.getAll().slice().sort((a,b)=> (b.lastOpened||0)-(a.lastOpened||0)).slice(0,limit);
  }

  public groupsByCategory() {
    const out: Record<string, ProjectEntry[]> = {};
    this.getAll().forEach(p=>{
      const k = p.category || 'Uncategorized';
      out[k] = out[k] || [];
      out[k].push(p);
    });
    return out;
  }

  public groupsByLanguage() {
    const out: Record<string, ProjectEntry[]> = {};
    this.getAll().forEach(p=>{
      const k = p.language || 'Unknown';
      out[k] = out[k] || [];
      out[k].push(p);
    });
    return out;
  }

  public updateProject(originalPath: string, updates: Partial<ProjectEntry>) {
    const list = this.load();
    const p = list.find(x => x.path === originalPath);
    if (!p) return;

    const nextPath = typeof updates.path === 'string' ? updates.path.trim() : '';
    if (nextPath && nextPath !== originalPath) {
      const collision = list.find(x => x.path === nextPath);
      if (collision && collision !== p) {
        throw new Error('Another project already exists at: ' + nextPath);
      }
    }

    const nextName = typeof updates.name === 'string' ? updates.name.trim() : '';
    if (nextName) p.name = nextName;

    if (nextPath) p.path = nextPath;

    if (typeof updates.category === 'string') p.category = updates.category;
    if (typeof updates.language === 'string') p.language = updates.language;
    if (typeof updates.color === 'string') p.color = updates.color;
    if (typeof updates.pinned === 'boolean') p.pinned = updates.pinned;
    if (Array.isArray(updates.tags)) p.tags = updates.tags;

    this.save();
  }
}



================================================
FILE: src/ProjectTreeDataProvider.ts
================================================
import * as vscode from 'vscode';
import { ProjectRegistry } from './ProjectRegistry';
import { ProjectEntry } from './models';

type Node = { type: 'root' | 'pinned' | 'recent' | 'category' | 'language' | 'project'; key: string, label?: string, project?: ProjectEntry };

export class ProjectTreeDataProvider implements vscode.TreeDataProvider<Node> {
  private registry: ProjectRegistry;
  private _onDidChangeTreeData: vscode.EventEmitter<Node | undefined | null | void> = new vscode.EventEmitter();
  readonly onDidChangeTreeData: vscode.Event<Node | undefined | null | void> = this._onDidChangeTreeData.event;

  constructor(registry: ProjectRegistry) {
    this.registry = registry;
  }

  refresh(): void {
    this._onDidChangeTreeData.fire();
  }

  getTreeItem(element: Node): vscode.TreeItem | Thenable<vscode.TreeItem> {
    if (element.type === 'project' && element.project) {
      const item = new vscode.TreeItem(element.label || element.project.name, vscode.TreeItemCollapsibleState.None);
      item.description = element.project.path;
      item.contextValue = 'projectItem';
      item.command = {
        command: 'projectDashboard.openProjectFromTree',
        title: 'Open Project',
        arguments: [element.project.path]
      };
      // item.iconPath = element.project.pinned ? new vscode.ThemeIcon('star-full') : new vscode.ThemeIcon('folder');
      return item;
    }
    const collapsible = (element.type === 'category' || element.type === 'language');
    const item = new vscode.TreeItem(element.label || element.key, collapsible ? vscode.TreeItemCollapsibleState.Collapsed : vscode.TreeItemCollapsibleState.None);
    if (element.type === 'pinned') item.iconPath = new vscode.ThemeIcon('star');
    if (element.type === 'recent') item.iconPath = new vscode.ThemeIcon('history');
    return item;
  }

  async getChildren(element?: Node | undefined): Promise<Node[]> {
    if (!element) {
      return [
        { type: 'pinned', key: 'pinned', label: 'Pinned' },
        { type: 'recent', key: 'recent', label: 'Recent' },
        { type: 'category', key: 'categories', label: 'Categories' },
        { type: 'language', key: 'languages', label: 'Languages' }
      ];
    }
    switch (element.type) {
      case 'pinned': {
        const pinned = this.registry.getPinned();
        return pinned.map(p => ({ type: 'project', key: p.id, label: p.name, project: p }));
      }
      case 'recent': {
        const recent = this.registry.getRecent(20);
        return recent.map(p => ({ type: 'project', key: p.id, label: p.name, project: p }));
      }
      case 'category': {
        if (element.key === 'categories') {
          const groups = this.registry.groupsByCategory();
          return Object.keys(groups).map(k => ({ type: 'category', key: `cat:${k}`, label: `${k} (${groups[k].length})` }));
        }
        if (element.key.startsWith('cat:')) {
          const k = element.key.slice(4);
          const groups = this.registry.groupsByCategory();
          const list = groups[k] || [];
          return list.map(p => ({ type: 'project', key: p.id, label: p.name, project: p }));
        }
        return [];
      }
      case 'language': {
        if (element.key === 'languages') {
          const groups = this.registry.groupsByLanguage();
          return Object.keys(groups).map(k => ({ type: 'language', key: `lang:${k}`, label: `${k} (${groups[k].length})` }));
        }
        if (element.key.startsWith('lang:')) {
          const k = element.key.slice(5);
          const groups = this.registry.groupsByLanguage();
          const list = groups[k] || [];
          return list.map(p => ({ type: 'project', key: p.id, label: p.name, project: p }));
        }
        return [];
      }
      default:
        return [];
    }
  }
}



================================================
FILE: src/utils.ts
================================================
import * as vscode from 'vscode';
import * as path from 'path';

export function isWorkspaceFile(p: string) {
  return p.endsWith('.code-workspace');
}

export function basename(p: string) {
  return path.basename(p);
}

export function now() {
  return Date.now();
}

export function safeNameFromPath(p: string) {
  if (!p) return '';
  return basename(p).replace(/\.code-workspace$/, '');
}


