Skip to content

fix(web): compare and product page show invented values for unknown specs #1193

Closed

Description

@JOY

Follow-up to #1186 / PR #1192 (found in its review).

Problem

When a spec is unknown, some rows print a made-up value instead of nothing:

  • Compare (apps/web/src/components/compare/CompareWorkspace.tsx):
    • cell_5g shows "4G LTE" when has_5g is unknown.
    • mm_speaker defaults to "stereo" (valDefaultStereo).
    • conn_usb_gps defaults to "USB Type-C".
    • avail_announced defaults to "Đang mở bán chính hãng" (valDefaultAvailable).
    • reg_cert defaults to "Đạt chuẩn hợp quy Bộ TT&TT Việt Nam" (valDefaultRegulatory).
  • Product page (apps/web/src/lib/product-spec-rows.ts): the 5G row prints "No" when neither specifications.cellular.has_5g nor has_5g is known, and the commercial status row defaults to "Đang kinh doanh" (availableStatus).

This is user-facing misinformation: a buyer reads a fact the catalogue does not have.

Fix

An unknown value is empty and follows #1186's rules:

  • the product page hides the row, and the group when no row is left;
  • compare shows "-" only where another column has a value, and hides the row when every column is empty.

Acceptance

  • No invented value for an unknown spec in compare or on the product page.
  • Known values are unchanged (a stored has_5g: false still reads "No").
  • Tests cover the unknown and known cases.

Activity

  1. added
    agent:webClaimed by Agent: Web
    status:readyTask ready to be picked up by an Agent
    status:in-progressTask currently claimed and being worked on by an Agent
    on Oct 28, 2026
  2. self-assigned this
    on Oct 28, 2026
  3. added
    status:in-reviewTask completed and waiting for review / PR merge
    and removed
    status:readyTask ready to be picked up by an Agent
    status:in-progressTask currently claimed and being worked on by an Agent
    on Oct 28, 2026
  4. added
    status:doneTask completed and verified
    and removed
    status:in-reviewTask completed and waiting for review / PR merge
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent:webClaimed by Agent: Webarea:frontendFrontend / Next.js / UIstatus:doneTask completed and verified

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions