Repository navigation
Conversation
Signed-off-by: Sunny <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes align with the backend contract, cover both empty states, and have no unresolved blocking findings.
No open issues 🎉
What changed in this PR
This PR updates the Home dashboard sparklines to distinguish disabled observability from an enabled system with no traffic, using the backend’s enabled flag.
Changes:
- Add distinct empty-state messages in English, Spanish, and Portuguese.
- Replace handwritten metrics types with generated types and update the OpenAPI schema.
- Add regression coverage for both empty states and align test fixtures with generated types.
| File | Description |
|---|---|
src/types/metrics.ts |
Remove handwritten metrics response types. |
src/i18n/locales/pt-BR/dashboard.json |
Add Portuguese empty-state messages. |
src/i18n/locales/es-ES/dashboard.json |
Add Spanish empty-state messages. |
src/i18n/locales/en-US/dashboard.json |
Add English empty-state messages. |
src/hooks/useMetrics.ts |
Import generated response types. |
src/hooks/useMetrics.test.ts |
Align fixtures with generated response types. |
src/components/dashboard/SystemSparklinesCardConnected.test.tsx |
Update connected-card metrics fixtures. |
src/components/dashboard/SystemSparklinesCard.tsx |
Select the empty-state message using observability status. |
src/components/dashboard/SystemSparklinesCard.test.tsx |
Cover disabled observability and enabled-with-no-traffic states. |
src/api/metrics.ts |
Use generated metrics response types. |
openapi.json |
Add enabled to both metrics response schemas. |
Review effort: Balanced
There was a problem hiding this comment.
timeseries?.enabled === false || percentiles?.enabled === false is only true when the response includes enabled. An API without [IBM/mcp-context-forge#7326](IBM/mcp-context-forge#7326) leaves the field out, so the card shows empty.noTraffic and tells users with tracing turned off that they have no traffic. The UI is released under its own tags, so the problem remains after #7326 merges. Showing dashboard.home.sparklines.empty when the state is unknown fixes it:
// An API older than #7326 reports neither state.
const tracingEnabled = timeseries?.enabled ?? percentiles?.enabled;
const emptyMessageId =
tracingEnabled === undefined
? "dashboard.home.sparklines.empty"
: tracingEnabled
? "dashboard.home.sparklines.empty.noTraffic"
: "dashboard.home.sparklines.empty.disabled";
This keeps the existing key in each locale file, so #200 only needs to merge the content changes. A test that leaves out enabled and checks for the OBSERVABILITY_ENABLED message would cover it.
scripts/refresh-openapi.sh generates openapi.json and sets info.version, currently 1.1.0+42a06c. A manual edit breaks that version match, and the next refresh removes enabled, so timeseries?.enabled no longer compiles. Merge #7326, regenerate the spec with the script, then rebase.
Signed-off-by: Sunny <[email protected]>
4464abb to
b46e077
Compare
|
Hi @a-effort, Thank you for the detailed review. I've pushed commit
The DCO check is now passing, and the working tree is clean. I understand the OpenAPI schema concern. I'll wait for backend PR IBM/mcp-context-forge#7326 to merge, then regenerate the schema using Please let me know if there are any additional frontend changes you'd like. Thanks, |
|
@sunny-kavixo - please resolve conflicts |
|
Hi @marekdano and @a-effort, Thank you for the review and detailed feedback. I'm currently working on resolving the merge conflicts and addressing the requested changes, including backward compatibility for older API responses and the OpenAPI generation concerns. I'll carefully validate the changes and run the relevant tests before updating this PR. Please allow me some time to complete the fixes. I'll post an update once everything is ready for re-review. Thank you for your patience and guidance. Best regards, |
Signed-off-by: Sunny <[email protected]>
|
Hi @marekdano, @a-effort, The merge conflicts with
Ready for re-review. Thank you! |
marekdano
left a comment
There was a problem hiding this comment.
@sunny-kavixo - thanks for your contribution!
The PR looks good! LGTM 🚀
|
Hi @marekdano, Thank you for reviewing and approving PR #203. I appreciate your feedback and support! The merge conflicts have been resolved, and all currently reported checks are passing. Please let me know if anything else is needed from my side before the merge. Thanks again! |
|
Hi @a-effort, Thank you for your earlier review and feedback. The backward-compatibility changes and merge conflicts have been addressed, and the updated PR has now received approvals from @marekdano and @vishu-bh. All currently reported CI checks are passing. Could you please confirm whether your previous change request has been fully addressed? I understand that the generated OpenAPI integration remains dependent on backend PR #7326. Thank you for your time and guidance. Best regards, |
Summary
• Distinguish disabled observability from enabled observability with no traffic on Home sparklines, while preserving the legacy empty state when
enabledis omitted.• Add English, Spanish, and Portuguese empty-state translations (
empty.disabled,empty.noTraffic, and upstream-clarifiedempty).• Retain clean client typing via local intersection typing without manual schema edits, pending Backend #7326 merge.
• Add regression tests covering all three observability empty states.
Verification
• Full Vitest suite: 3,796 passed, 1 skipped (227 files passed).
• TypeScript (
tsc -b), ESLint, Prettier, and production build passed.Related issue: IBM/mcp-context-forge#7312
Backend dependency: IBM/mcp-context-forge#7326