Repository navigation
Add custom risk levels to the risk matrix widget - #29
Merged
Merged
Conversation
A risk method can now give its own risk levels and a level grid, so the matrix colours follow the method instead of the position of each cell. Levels pick steps of a fixed five-step colour scale (green, light green, amber, red, dark red) and are listed in a legend. Cells without a valid level are drawn in grey with a warning. Without the new parameters the matrix looks as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Duplicate level names can collapse Vega-Lite color and legend categories; validation or numeric scale keys are needed.
Review effort: Lite
Findings: None
What changed in this PR
This PR adds optional custom risk levels and per-cell risk grids to the risk matrix widget while preserving default behavior.
Changes:
- Adds paired
levelsandlevelGridschema parameters. - Supports custom colors, legends, contrast-aware text, and invalid-grid warnings.
- Documents and demonstrates custom configurations.
| File | Summary |
|---|---|
cardRoot/base_h8a3eqto/c/base_4c0lf8u0/c/base_kxwagxhg/index.adoc |
Adds usage examples and validation cases. |
.cards/local/reports/riskMatrixWidget/parameterSchema.json |
Defines custom risk-level parameters and pairing rules. |
.cards/local/reports/riskMatrixWidget/index.adoc.hbs |
Renders custom grids, colors, legends, and warnings. |
.cards/local/reports/riskMatrixWidget.json |
Updates widget metadata. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
henryhaverinen
deleted the
feature/henryhaverinen/risk-matrix-levels
branch
September 23, 2026 12:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The risk matrix widget colours each cell by its position in the two scales. Risk methods that define their own risk table don't line up with that. In ISMS essentials, for example, 4 of the 25 cells show the wrong colour, and its five risk levels can't be shown with three colours.
This PR adds two optional parameters so a method can colour the matrix with its own table:
levels: 2 to 5 risk levels, lowest first. Each has anameand acolourstep from 1 to 5 on a fixed scale: green#0ca30c, light green#b5e68a, amber#fab219, red#d03b3b, dark red#7a1414.levelGrid: one row per likelihood level, lowest first, with one entry per impact level. Each entry is a 1-based position inlevels.Behaviour:
Colour choices
The two new steps were picked with a colour-difference check (OKLab ΔE, including simulated protan, deutan and tritan vision):
Light green has low contrast against a white page (1.40:1). Amber is already similar (1.79:1), and the gaps between cells and the legend compensate.
Test plan
cyberismo validatepasses.🤖 Generated with Claude Code