Skip to content

feat: view and edit a project's risk level in Manage > Projects - #86

Merged
HemSoft merged 2 commits into
mainfrom
feat/project-risk-level
Nov 6, 2026
Merged

HemSoft merged 2 commits into
mainfrom
feat/project-risk-level

Conversation

@HemSoft

@HemSoft HemSoft commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Risk level: 2/10 (project-dashboard)
Worked on by: Claude Opus 5.5 on home, for Chief request discord-1568058109484597350

What

pmd added a 0-10 risk level per project in project-manager#104 (riskLevel, optional on PUT /v1/projects/{slug},
default 5 for new rows). Until now the dashboard couldn't show or edit it. This PR adds it to Manage > Projects:

  • List: a Risk column (4/10, or — when pmd gives none). The row's accessible label includes it as well.
  • Editor: a 0-10 chooser under Priority. Picking a value only edits the form. Save sends it in the same full-row
    PUT with If-Match.
  • Changed elsewhere: risk level is one of the form's fields, so a 409 stale_version shows Risk level: yours 8, now 6 next to the other differences. Reapply and Discard work the same as for every other field.
  • pmd's range error (400 bad_request, "riskLevel must be an integer 0-10") goes on the field, because its message
    starts with the field name. The client checks 0 to 10 before sending.

Rows from an older pmd

A row without riskLevel, or with null, reads as unset. It shows — in the list and "Not set in pmd. Pick one to
set it." in the editor, and it saves without the key. Two reasons: pmd refuses null
(intValue treats null as missing), and a pmd from before #104 would reject an unknown key. A new project also
leaves the key out ("Not set: pmd starts a new project at 5."), so pmd applies its own default. A value outside
0-10 in a response reads as unset, the same way an unknown priority tier already does.

The board's main table still doesn't show risk. It reads /v1/projects through pmd.rs, and a new board column would
be a separate change.

Tests

Two commits: abf636d (the feature and its tests) and d18e565 (one more headless capture, nothing else).

cargo test --workspace --locked on Windows: 417 passed, 0 failed. New tests:

  • dashboard-core/tests/projects.rs: parsing (present, missing, null, out of range, wrong type), the body (0 and 10
    are sent; empty or blank leaves the key out; 11, -1, 4.5 and high are refused on the field), the conflict
    difference and reapply on the new version, and pmd's 400 landing on riskLevel against the loopback stub.
  • dashboard-app/src/projects_tests.rs (headless): picking a value doesn't write until Save, then the list shows the
    new value; a risk changed elsewhere shows both values and reapplies with the new If-Match; a list from an older
    pmd shows — and saves without riskLevel; a new project shows the pmd-default note.

cargo fmt --all --check and cargo clippy --workspace --all-targets --locked -- -D warnings are clean.

Screenshots

Rendered headlessly on Linux (mini) with CAPTURE_DIR=… cargo test -p dashboard-app captures -- --ignored at head
d18e565. All 14 capture tests passed and no window opened.

List with the Risk column (projects-list):

Projects list with a Risk column

Editor with the 0-10 chooser, 8 picked and not yet saved (projects-edit-risk):

Project editor with the risk level chooser

Changed elsewhere: risk changed to 6 in pmd while 8 was being saved (projects-risk-conflict). This capture was
added in d18e565. It uses a 1000 px window because at the existing 760 px conflict capture the panel sits below the
dialog's scroll fold, as it already did before this PR.

Changed elsewhere showing the risk level difference

At 150% zoom:

Projects list at 150%
Project editor at 150%

🤖 Generated with Claude Code

pmd gained a 0-10 risk level per project (project-manager#104). The Projects
dialog now lists it in a Risk column and edits it with a 0-10 chooser beside
priority. The value rides the existing full-row PUT with If-Match, so the
"Changed elsewhere" flow shows a risk difference like any other field, and
pmd's 400 ("riskLevel must be an integer 0-10") lands on the field.

A row without riskLevel (a pmd that predates it) reads as unset, shows as
"—", and saves without the field, since pmd refuses null and an older pmd
refuses the unknown key. A new project leaves it to pmd, which starts at 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HemSoft

HemSoft commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@sfl review

@hemsoft-sfl-reviewer

Copy link
Copy Markdown

SFL review stopped: failed; post a fresh request.

@HemSoft

HemSoft commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T01:21:16.949974Z d18e565 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: abf636db83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The existing conflict capture at 760 px leaves the panel below the fold, so the
risk difference had no screenshot. This adds projects-risk-conflict at 1000 px
on gh-x, which has a checkout and so no Link checkout box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HemSoft

HemSoft commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: d18e565df6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@HemSoft
HemSoft merged commit b6b5450 into main Nov 6, 2026
5 checks passed
@HemSoft
HemSoft deleted the feat/project-risk-level branch November 6, 2026 20:31
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.

1 participant