Skip to content

fix(dashboard): distinguish disabled observability from no traffic - #203

Merged
marekdano merged 5 commits into
contextforge-org:mainfrom
sunny-kavixo:fix/7312-sparklines-empty-states
Oct 28, 2026
Merged

marekdano merged 5 commits into
contextforge-org:mainfrom
sunny-kavixo:fix/7312-sparklines-empty-states

Conversation

@sunny-kavixo

@sunny-kavixo sunny-kavixo commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

• Distinguish disabled observability from enabled observability with no traffic on Home sparklines, while preserving the legacy empty state when enabled is omitted.
• Add English, Spanish, and Portuguese empty-state translations (empty.disabled, empty.noTraffic, and upstream-clarified empty).
• 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@a-effort a-effort left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sunny-kavixo
sunny-kavixo force-pushed the fix/7312-sparklines-empty-states branch from 4464abb to b46e077 Compare October 24, 2026 04:27
@sunny-kavixo

Copy link
Copy Markdown
Contributor Author

Hi @a-effort,

Thank you for the detailed review.

I've pushed commit b46e077, which addresses the backward-compatibility feedback:

  • Preserves the original empty-state message when the API omits enabled.
  • Distinguishes explicitly disabled tracing from enabled observability with no traffic.
  • Retains the existing localization key across English, Spanish, and Portuguese.
  • Adds regression coverage for all three states.

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 scripts/refresh-openapi.sh and rebase as appropriate.

Please let me know if there are any additional frontend changes you'd like.

Thanks,
Putluru Sandeep

@marekdano
marekdano requested a review from a-effort October 27, 2026 09:25
@marekdano

Copy link
Copy Markdown
Contributor

@sunny-kavixo - please resolve conflicts

@sunny-kavixo

Copy link
Copy Markdown
Contributor Author

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,
Putluru Sandeep (@sunny-kavixo)

@sunny-kavixo

Copy link
Copy Markdown
Contributor Author

Hi @marekdano, @a-effort,

The merge conflicts with main have been safely resolved:

Ready for re-review. Thank you!

@marekdano marekdano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunny-kavixo - thanks for your contribution!

The PR looks good! LGTM 🚀

@sunny-kavixo

Copy link
Copy Markdown
Contributor Author

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!
Putluru Sandeep (@sunny-kavixo)

@vishu-bh vishu-bh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sunny-kavixo for the contribution.

Code looks clean and well alligned.

LGTM 🚀

@sunny-kavixo

Copy link
Copy Markdown
Contributor Author

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,
Putluru Sandeep

@a-effort a-effort left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@marekdano
marekdano merged commit cf910e6 into contextforge-org:main Oct 28, 2026
5 of 6 checks passed
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.

5 participants