Style mismatches shown on the dashboard - #24
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change adds a shared top-issue contract, propagates issues through score and dashboard projections, and displays color and typography mismatches as informational evidence in contract details. ChangesStyle mismatch dashboard evidence
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🔵 Low · up to The PR adds style-mismatch details to dashboard results and the UI. It is mergeable with owner awareness because live-run data is less strictly validated than durable reports, so malformed attachment data could be displayed inconsistently and merits follow-up validation. Sequence Diagram(s)sequenceDiagram
participant Matcher
participant ScoreAttachment
participant ReportProjection
participant DashboardServer
participant ContractDetails
Matcher->>ScoreAttachment: provide topIssues
ScoreAttachment->>ReportProjection: expose typed topIssues
ReportProjection->>DashboardServer: assemble contract result
DashboardServer->>ContractDetails: provide dashboard topIssues
ContractDetails->>ContractDetails: filter style-color and style-typography
ContractDetails->>ContractDetails: render informational evidence
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThe PR propagates visual-score top issues through the contracts, durable-report, and live-report layers, then displays color and typography mismatches on the dashboard.
|
| Filename | Overview |
|---|---|
| packages/playwright/src/report-projection.ts | Projects each score attachment’s top issues and aggregates all matcher calls into the test’s single live dashboard row, resolving the previously reported omission. |
| packages/contracts/src/score.ts | Adds strict validation and exported typing for visual-score top issues. |
| packages/contracts/src/dashboard.ts | Extends dashboard contract assembly to include non-empty top-issue collections. |
| packages/dashboard-server/src/model.ts | Propagates validated top issues from durable visual-score artifacts into dashboard results. |
| apps/dashboard/components/ContractDetails.vue | Filters color and typography issues into an optional informational style-mismatch panel. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Matcher score attachments] --> B[deriveContract per matcher]
B --> C[Aggregate topIssues in finalizeTestEnd]
C --> D[Live dashboard contract]
E[visual-score.json] --> F[Durable report projection]
F --> G[Dashboard contract]
D --> H[ContractDetails style mismatch panel]
G --> H
Reviews (2): Last reviewed commit: "Implement style mismatch tracking in Con..." | Re-trigger Greptile
This update introduces a new computed property to track style mismatches related to color and typography issues in the ContractDetails component. The changes include displaying these mismatches in the UI, enhancing the contract result structure to include topIssues, and updating the relevant schemas and types across the dashboard and contracts packages. Additionally, tests have been added to ensure proper projection of style-comparison issues in the dashboard. Closes #17
2bce7a0 to
b575e64
Compare
…#24) This commit introduces a new utility function, `hasEvidenceNotes`, to determine if the evidence-notes section of a contract has any relevant information to display. The `ContractDetails` component has been updated to utilize this function, simplifying the conditional rendering logic. Additionally, tests for the new utility function have been added to ensure its correctness. Closes #24
This commit introduces a new utility function, `hasEvidenceNotes`, to determine if the evidence-notes section of a contract has any relevant information to display. The `ContractDetails` component has been updated to utilize this function, simplifying the conditional rendering logic. Additionally, tests for the new utility function have been added to ensure its correctness. Closes #24
Summary
packages/contracts/src/score.ts— addtopIssueSchema(mirrors@framelia/verify'sTopIssue; contracts can't import it directly since verify depends on contracts, not the reverse) and threadtopIssuesthroughvisualScoreArtifactSchema.packages/contracts/src/dashboard.ts— addDashboardTopIssuetype andtopIssuesfield onDashboardContractResult, wired throughassembleContractResult(one conditional-spread, following the file's existing convention for optional fields).packages/playwright/src/score-attachment.ts— tightenFrameliaScoreAttachment.topIssuesfrom a loose 3-field inline type to the realTopIssue[]shape (matches whatbuildScoreAttachmentalready assigned at runtime).packages/playwright/src/report-projection.ts(deriveContract) andpackages/dashboard-server/src/model.ts(deriveContractResult) — passtopIssuesthrough toassembleContractResulton both the live-run and durable-report paths.apps/dashboard/components/ContractDetails.vue— new "Style mismatches vs. Figma" panel, filtered tostyle-color/style-typographyissue kinds, following the existing Blockers/Diagnostics list pattern. No mismatches → panel simply doesn't render (v-if), consistent with how every other optional section in this file behaves.Closes #11
Judgement calls
messagestring as-is (already formatted asstyle mismatch on ${field}: expected ${expected}, actual ${actual}) rather than parsing it into structured expected/actual columns — matches how every othertopIssues/diagnostics consumer in the codebase renders these, and avoids wideningTopIssue's shape for one UI.v-ifwhen there are no style mismatches, matching every other optional section inContractDetails.vue(Blockers, Diagnostics, Mask evidence, etc.), none of which show an empty-state message either.apps/dashboard/testshas no existing component-mount test infrastructure (all tests arelib//composables/unit tests), so introducing one for this single panel was out of scope; instead added logic-level coverage at the two derivation points that actually own the behavior (dashboard-server'sprojectArtifact,playwright'sFrameliaReporter).Test plan
packages/dashboard-server/tests/model.test.ts(+2): a scored contract withtopIssuesprojectstopIssuesonto the dashboard result; a scored contract with none omits the field entirelypackages/playwright/tests/reporter.test.ts(+1): a matcher'sstyle-colortopIssue on the live score attachment surfaces on/api/run's contract entrypnpm -r typecheck(6/6 packages) andpnpm -r test(contracts/verify/playwright 41/41/dashboard-server 17/17/dashboard 41/41/cli 63/63) all greenpnpm lint/pnpm fmt:checkcleanSummary by CodeRabbit
New Features
Bug Fixes
Tests