Skip to content

docs(#4499): add frontend conventions to scorecard AGENTS.md - #4500

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/4499-frontend-conventions
Open

docs(#4499): add frontend conventions to scorecard AGENTS.md#4500
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/4499-frontend-conventions

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Add a Frontend Component Conventions section documenting four conventions that the review agent missed on PR #4395:

  1. i18n translation key namespaces: keys are organized by domain
    in ref.ts (metric., aggregation., thresholds., errors.,
    common.). Aggregation type labels belong under aggregation.,
    not metric.*.

  2. Empty/error state rendering: scalar cards with no successful
    samples (result.total === 0) must render in neutral grey, not
    apply threshold coloring. ScalarStatCard guards this with a
    total > 0 check before threshold evaluation.

  3. AggregatedMetricCard dispatch: uses result-shape discrimination
    (numeric value field vs values[] array) via type guards in
    isScalarAggregation.ts, not aggregation type name matching.

  4. Frontend/backend threshold boundary: threshold evaluation is
    the backend responsibility. The frontend mirrors the logic for
    display coloring only (RHIDP-16510 tracks deferring to
    backend-provided values).


Closes #4499

Post-script verification

  • Branch is not main/master (agent/4499-frontend-conventions)
  • Secret scan passed (gitleaks — 08e6312205c83d9bd493e5dbc6f7af94d021af8e..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

Add a Frontend Component Conventions section documenting four
conventions that the review agent missed on PR #4395:

1. i18n translation key namespaces: keys are organized by domain
   in ref.ts (metric.*, aggregation.*, thresholds.*, errors.*,
   common.*). Aggregation type labels belong under aggregation.*,
   not metric.*.

2. Empty/error state rendering: scalar cards with no successful
   samples (result.total === 0) must render in neutral grey, not
   apply threshold coloring. ScalarStatCard guards this with a
   total > 0 check before threshold evaluation.

3. AggregatedMetricCard dispatch: uses result-shape discrimination
   (numeric value field vs values[] array) via type guards in
   isScalarAggregation.ts, not aggregation type name matching.

4. Frontend/backend threshold boundary: threshold evaluation is
   the backend responsibility. The frontend mirrors the logic for
   display coloring only (RHIDP-16510 tracks deferring to
   backend-provided values).

Closes #4499
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.66%. Comparing base (08e6312) to head (1ed4432).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4500   +/-   ##
=======================================
  Coverage   61.66%   61.66%           
=======================================
  Files        2572     2572           
  Lines      102950   102950           
  Branches    28857    28855    -2     
=======================================
  Hits        63482    63482           
  Misses      37614    37614           
  Partials     1854     1854           
Flag Coverage Δ *Carryforward flag
adoption-insights 84.55% <ø> (ø) Carriedforward from 08e6312
ai-integrations 69.09% <ø> (ø) Carriedforward from 08e6312
app-defaults 55.55% <ø> (ø) Carriedforward from 08e6312
augment 46.67% <ø> (ø) Carriedforward from 08e6312
boost 79.84% <ø> (ø) Carriedforward from 08e6312
bulk-import 72.79% <ø> (ø) Carriedforward from 08e6312
cost-management 13.55% <ø> (ø) Carriedforward from 08e6312
dcm 72.09% <ø> (ø) Carriedforward from 08e6312
e2e-adoption-insights 60.00% <ø> (ø) Carriedforward from 08e6312
e2e-extensions 62.13% <ø> (ø) Carriedforward from 08e6312
e2e-global-header 49.45% <ø> (ø) Carriedforward from 08e6312
e2e-homepage 61.11% <ø> (ø) Carriedforward from 08e6312
e2e-intelligent-assistant 46.65% <ø> (ø) Carriedforward from 08e6312
e2e-orchestrator 49.52% <ø> (ø) Carriedforward from 08e6312
e2e-orchestrator-plugin 49.51% <ø> (ø) Carriedforward from 08e6312
e2e-quickstart 55.21% <ø> (ø) Carriedforward from 08e6312
e2e-scorecard 50.21% <ø> (ø) Carriedforward from 08e6312
e2e-theme 16.36% <ø> (ø) Carriedforward from 08e6312
extensions 56.59% <ø> (ø) Carriedforward from 08e6312
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 08e6312
global-header 66.50% <ø> (ø) Carriedforward from 08e6312
homepage 48.39% <ø> (ø) Carriedforward from 08e6312
install-dynamic-plugins 58.57% <ø> (ø) Carriedforward from 08e6312
intelligent-assistant 75.35% <ø> (ø) Carriedforward from 08e6312
konflux 91.98% <ø> (ø) Carriedforward from 08e6312
lightspeed 69.02% <ø> (ø) Carriedforward from 08e6312
mcp-integrations 84.14% <ø> (ø) Carriedforward from 08e6312
orchestrator 70.87% <ø> (ø) Carriedforward from 08e6312
quickstart 63.74% <ø> (ø) Carriedforward from 08e6312
sandbox 79.56% <ø> (ø) Carriedforward from 08e6312
scorecard 87.65% <ø> (ø)
theme 88.76% <ø> (ø) Carriedforward from 08e6312
translations 5.12% <ø> (ø) Carriedforward from 08e6312
x2a 77.10% <ø> (ø) Carriedforward from 08e6312

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08e6312...1ed4432. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 31, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 4:35 PM UTC · Completed 4:40 PM UTC

Commit: 1ed4432 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $0.77

@fullsend-ai-review

Copy link
Copy Markdown

Review — Approve

Scope: docs-only — adds a ## Frontend Component Conventions section to workspaces/scorecard/AGENTS.md (79 lines added, 0 deleted, single file).

Verification against source code

All four documented conventions were verified against the current codebase:

  1. i18n translation key namespacesref.ts confirms the five listed namespaces (metric.*, aggregation.*, thresholds.*, errors.*, common.*) exist as top-level keys in scorecardMessages. The guidance to place aggregation-specific labels under aggregation.* rather than metric.* is consistent with the existing structure (lines 189–195 of ref.ts).

  2. Empty/error state renderingScalarStatCard.tsx (lines 68–78) confirms the result.total > 0 guard before calling getMatchingThresholdKey(), and the fallback to theme.palette.grey[500] when matchingThresholdKey is undefined. The documented behavior matches the implementation exactly.

  3. AggregatedMetricCard dispatch patternisScalarAggregation.ts confirms all three type guards use structural checks:

    • isScalarAggregationResult: typeof result.value === 'number' && !('values' in result)
    • isDistributionAggregationResult: Array.isArray(result.values)
    • isWeightedStatusScoreResult: distribution check + typeof result.weightedStatusScore === 'number'

    AggregatedMetricCard.tsx confirms dispatch by shape, not aggregation type name.

  4. Frontend/backend threshold boundarymatchThresholdRule.ts exports getMatchingThresholdKey() as documented. getStatusConfig and resolveStatusColor are confirmed in utils/index.ts. The RHIDP-16510 follow-up tracker reference is noted.

Intent & coherence

The PR directly addresses issue #4499 (retro agent finding from PR #4395), which identified that the review agent missed two frontend convention violations because AGENTS.md had zero frontend guidance. The four documented conventions are well-scoped and directly address the gap.

Assessment

No findings. The documentation is accurate, well-structured, and properly scoped to the scorecard workspace's frontend conventions.


Labels: PR adds frontend documentation conventions to scorecard workspace AGENTS.md

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge documentation Improvements or additions to documentation labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation ready-for-merge All reviewers approved — ready to merge ready-for-review Agent PR ready for human review workspace/scorecard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add frontend conventions to scorecard AGENTS.md for empty states and i18n namespaces

0 participants