feat(playground): Add Risk review view to compare mode#118
Merged
Conversation
Adds a fifth `Risk review` option to the compare-format select that runs the wasm `review_from_sql` binding instead of `diff_from_sql`, keeping `WorkbenchMode = "compare"` unchanged. `runCompareMode` now short-circuits to a dedicated `runReviewView` early-return path so the existing diff pipeline never fires when the review view is active. The new `review-panel` surface renders severity badges (`breaking / caution / warning / info`) sourced from `ReviewResult.summary`, finding cards sorted by severity descending with rule_id, target (table.column / table.fk_name / `(schema)`), message and mitigation, plus a `<details>` panel for findings excluded by `--except-table`. `resetOutputPanels` clears the review panel root and child lists so re-entering the view does not show stale state. `isCompareView` now accepts `"review"` so the URL state guard does not fall back to `"visual"` for shared `?compare=review` links, the PersistedState round-trip stays intact, and the wasm import surface in `relune_wasm.d.ts` is widened with `review_from_sql` / `review_from_schema_json`. Copy JSON / Download JSON wire to the CLI equivalent flattened JSON in `WasmReviewResponse.content`, matching `relune review --format json -o`.
Code Metrics Report
Details | | main (0ca4bbe) | #118 (4396cb1) | +/- |
|---------------------|----------------|----------------|------|
| Coverage | 94.6% | 94.6% | 0.0% |
| Files | 81 | 81 | 0 |
| Lines | 37324 | 37324 | 0 |
| Covered | 35344 | 35344 | 0 |
- | Test Execution Time | 1m34s | 1m36s | +2s |Reported by octocov |
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
Risk reviewoption to the compare-format select that runs the wasmreview_from_sqlbinding alongside the existingVisual diff/Text/Markdown/Structured JSONviews, without splitting compare into a new workbench mode.ReviewResultso the playground consumes the same payload shape asrelune review --format json.?compare=reviewlinks and exported reports stay in lockstep with the CLI.Changes
CompareViewtovisual | text | markdown | json | review, exposesreview_from_sql/review_from_schema_jsonfrom the wasm type stub, and short-circuitsrunCompareModeinto a dedicatedrunReviewViewso the diff pipeline never fires when the review view is active.review-panelsurface with severity badges, sorted finding cards ((schema)fallback target included), and a<details>panel for--except-tablesuppressed findings, plus matching CSS for severity-coded borders / badges in light and dark themes.isCompareViewto accept"review"and broadensresetOutputPanelsto clear the review panel root and child lists so re-entering the view never shows stale badges or finding cards.