Skip to content

feat: apply price card glow up to top locations and top products (#6846)#7462

Open
VisheshKamble wants to merge 2 commits intoopenfoodfacts:developfrom
VisheshKamble:fix/price-card-glow-up-6846
Open

feat: apply price card glow up to top locations and top products (#6846)#7462
VisheshKamble wants to merge 2 commits intoopenfoodfacts:developfrom
VisheshKamble:fix/price-card-glow-up-6846

Conversation

@VisheshKamble
Copy link
Copy Markdown

@VisheshKamble VisheshKamble commented Apr 12, 2026

⚠️ Acceptance Requirements

This Pull Request will only be accepted if:

  • ✅ It is linked to an issue (using linking keywords like Fixes, Closes, or Resolves)
  • ✅ The linked issue is assigned to the author of this PR

What

Added a shared Prices top-list card container to reuse the updated price card look and feel.
Applied the shared container to Top Products items.
Applied the shared container to Top Locations items.
Kept existing behavior and actions (navigation, counters, and action buttons) intact.
Preserved product image placeholder behavior for items without images/barcodes.

Screenshot or video

Fixes bug(s)

Closes #6846

Part of

@VisheshKamble
Copy link
Copy Markdown
Author

@teolemon Hi! I’ve completed the implementation for this PR and updated the description with the required details, including issue linking.

@teolemon
Copy link
Copy Markdown
Member

can you add a little screenshot of how it looks ? @VisheshKamble

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces a shared “top-list” card container to reuse the updated Prices card styling across multiple top-list pages.

Changes:

  • Added PriceTopListCard as a shared container widget for Prices top-list items.
  • Migrated Top Products list items to use PriceTopListCard.
  • Migrated Top Locations list items to use PriceTopListCard and adjusted internal layout.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/smooth_app/lib/pages/prices/prices_products_page.dart Replaces per-item SmoothCard + InkWell with the shared PriceTopListCard wrapper.
packages/smooth_app/lib/pages/prices/prices_locations_page.dart Wraps location items in PriceTopListCard and restructures content into Column + Wrap.
packages/smooth_app/lib/pages/prices/price_top_list_card.dart New reusable card widget encapsulating margin/padding/elevation/theme for top-list items.

Comment on lines +98 to +103
return PriceTopListCard(
onTap: () async => PriceLocationWidget.showLocationPrices(
locationId: item.locationId,
context: context,
),
child: Column(
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

PR description says existing behavior/actions are preserved, but this change makes the whole location card tappable and opens the location prices. Previously only the PriceCountWidget had navigation; please either remove the card-level onTap or update the PR description/UX to reflect the new interaction (and ensure it’s desired).

Copilot uses AI. Check for mistakes.
Comment on lines +117 to +146
PriceButton(
onPressed: () {},
title: '${item.userCount}',
iconData: PriceButton.userIconData,
tooltip: item.userCount == null
? null
: appLocalizations.prices_button_count_user(
item.userCount!,
),
),
PriceButton(
onPressed: () {},
title: '${item.productCount}',
iconData: PriceButton.productIconData,
tooltip: item.productCount == null
? null
: appLocalizations.prices_button_count_product(
item.productCount!,
),
),
PriceButton(
onPressed: () {},
title: '${item.proofCount}',
iconData: PriceButton.proofIconData,
tooltip: item.proofCount == null
? null
: appLocalizations.prices_button_count_proof(
item.proofCount!,
),
),
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

Because the card now has an onTap, the PriceButton widgets with onPressed: () {} become dead-ends: tapping them does nothing and also prevents the card tap from firing. If these buttons are meant to be informational only, consider passing onPressed: null (disabled) so taps fall through to the card; otherwise, provide real actions for them.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +26
start: 8.0,
end: 8.0,
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

Avoid the magic number 8.0 for horizontal margins; design_constants.dart already defines SMALL_SPACE = 8.0. Using the shared constant keeps spacing consistent and makes future spacing tweaks easier.

Suggested change
start: 8.0,
end: 8.0,
start: SMALL_SPACE,
end: SMALL_SPACE,

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 9.09%. Comparing base (4d9c7fc) to head (ebb790e).
⚠️ Report is 1361 commits behind head on develop.

Files with missing lines Patch % Lines
...th_app/lib/pages/prices/prices_locations_page.dart 0.00% 27 Missing ⚠️
...ooth_app/lib/pages/prices/price_top_list_card.dart 0.00% 10 Missing ⚠️
...oth_app/lib/pages/prices/prices_products_page.dart 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #7462      +/-   ##
==========================================
- Coverage     9.54%   9.09%   -0.45%     
==========================================
  Files          325     626     +301     
  Lines        16411   36650   +20239     
==========================================
+ Hits          1567    3335    +1768     
- Misses       14844   33315   +18471     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Apply the Price card glow up to other parts of the price XP

4 participants