Skip to content

Add a Projects dialog to track, edit and re-prioritize pmd projects #34

Closed

Description

@HemSoft

Description

The dashboard shows pmd's project priority in its Priority column (#24) and matches rows to pmd projects by the full owner/name of each checkout's origin. It cannot change either side. To track a repo, someone edits PORTFOLIO.md on mini and waits for pmd's import, and to show a repo the user edits repositories in config.toml by hand.

This issue adds a Projects dialog under the Manage menu from #33. It depends on project-manager#50, because pmd has no project write endpoint today. GET /v1/projects?all=1 is the only project call that exists.

Why

Franz wants to add and manage projects and their priorities without leaving the dashboard. Priority decides what the Chief works on next, so changing it should take a few clicks and be visible in the table right away.

Goal

From one dialog, a user can see every pmd project, track a new repo, edit a project's details, set P0–P5, untrack it, and link it to a local checkout so the dashboard shows it.

Decision for Franz: source of truth for priority

PORTFOLIO.md is the current source (design.md decision 3). Proposed in project-manager#50, and recommended there, is Option A. PORTFOLIO.md keeps seeding tiers. A priority set from this dialog is an override that the import never overwrites, and Reset to PORTFOLIO.md removes it. Options B (PORTFOLIO.md only, so this dialog cannot set priority) and C (the API becomes the source) are described in that issue.

This issue is written for Option A. If Franz picks B, drop the priority editing and the add, edit and untrack parts, and keep the read-only list and the checkout link. If he picks C, the dialog is the same but the "Reset" action and the source badge go away.

Acceptance Criteria

  • Manage > Projects… opens a dialog listing all projects from GET /v1/projects?all=1: slug, owner/name, effective priority as P0 to P5 or —, whether it is overridden, tracked or untracked, and whether a configured local checkout matches it.
  • The list sorts by priority then slug and filters by text. Untracked projects are hidden behind a Show untracked toggle.
  • Add project takes owner/name, slug (defaults to the repo name, lower case), priority, goal, notes and requires. It sends PUT with If-None-Match: *. pmd's unknown_repo, repo_not_installed and already_exists errors show against the repo field and the slug field.
  • Edit changes priority (a P0–P5 picker), goal, notes, requires and tracked. It sends PUT with If-Match set to the row's version.
  • Reset to PORTFOLIO.md sends priority: null, is offered only when the row is overridden, and shows the tier it falls back to.
  • Untrack asks for confirmation, states that data is kept and the project can be tracked again, and sends tracked: false. There is no delete.
  • A priority picker change needs an explicit Save. Nothing writes on selection alone.
  • Conflict handling follows #33. On 409 stale_version the dialog re-reads the project, shows the user's edits beside the new values, and offers Reapply or Discard. Validation errors from pmd show on the named field.
  • A project with no matching checkout offers Link checkout, a folder picker or path field. The dialog checks the folder's origin matches owner/name using the existing identity rules, then appends it to repositories in config.toml. A mismatch shows the origin it found and writes nothing.
  • After a save, the main table's Priority column and rows update without a manual refresh.
  • Keyboard: Tab order follows the visual order (filter, list, actions, form), arrows move through the list, Enter opens Edit, Delete is not bound, and Esc closes with the unsaved-edit confirm from Add a Manage menu, modal dialog frame and write-token support #33.
  • Without a write token or the project write scope, the list still opens read-only and the write controls are disabled with the reason.

Definition of Done

  • Request and response types, validation and the checkout-link logic live in dashboard-core with unit tests, including the stub-server cases for already_exists, stale_version, unknown_repo and a priority reset.
  • UI tests cover list, filter, add, edit, untrack, reset, link checkout and the read-only state.
  • README "Usage" documents the dialog and the source-of-truth behavior that was chosen.
  • cargo fmt --all --check, cargo clippy --workspace --all-targets --locked -- -D warnings and cargo test --workspace --locked pass.
  • The PR is reviewed and links this issue with Closes #n.

Validation

  • Run cargo test --workspace --locked and expect all new tests to pass.
  • Against a local pmd serve with a read,write:projects token, add a project, change it to P0, confirm the main table shows P0 without pressing F5, reset it, and confirm the PORTFOLIO.md tier returns.
  • Edit the same project in curl between opening the dialog and saving, and confirm the conflict state appears and no write happens.
  • The PR embeds current-head screenshots in its ## Validation section, rendered with the headless capture test and uploaded as GitHub attachments. The states are: project list, list with the untracked toggle on, Add form with a validation error, Edit with the priority picker open, the Reset action on an overridden project, the untrack confirm, the stale-version conflict, Link checkout with a mismatch, and the read-only state with no write token. Capture at the default window size and at 150% zoom. Add an inline recording of add, set priority and see the table change, or state why it is omitted.
  • Keyboard-only add and edit is shown by the recording or by UI tests. No manual screen-reader pass is required.

Activity

  1. HemSoft commented on Oct 26, 2026

    @HemSoft
    ContributorAuthor

    Decision (Franz, 2026-10-26 18:48 ET): "The priority should definitely live with the projects table." → Option C: pmd's projects table is the source of truth for project priority. Implications for this work:

    • Project priority writes through the API (and the dashboard's Projects dialog) are authoritative; import-portfolio must no longer overwrite them.
    • PORTFOLIO.md's priority table becomes a view generated from pmd (or is reduced to goals/notes with priorities read from the API); update design.md decision 3 accordingly.
    • One-time migration: current PORTFOLIO.md tiers seed the table, then the table wins.
    • The Chief's dispatch reads priorities from the API (scripts/pm.py), not from PORTFOLIO.md.

    For this issue: keep the P0–P5 editor; drop the "Reset to PORTFOLIO.md" override UI from option A.

  2. HemSoft commented on Oct 27, 2026

    @HemSoft
    ContributorAuthor

    Released in v0.7.0 (Release run 40511867973: windows and publish passed; tag on d176389), following option C (pmd's projects table owns priority; there's no reset UI). The Chief installs it on home.

    • project-dashboard-0.7.0-windows-x64.zip: SHA-256 1e778358073d80e97d10523093eb690ce390993cfe67fdd53a346a683bfebf58, matching the published .sha256.
    • project-dashboard-0.7.0-windows-x64.zip.sha256
    • project-dashboard.exe inside the zip: SHA-256 9727e76d60994d832a825bc52fca75db904961d0be3c35885d4e9744f57e889d.

    The live pmd serve validation steps weren't run, since I didn't write to the production pmd. The write contract is covered by stub-server tests.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions