Skip to content

feat(order-book): night-contrast refresh + selective glow on offer cards - #257

Merged
grunch merged 3 commits into
mainfrom
feat/order-book-night-contrast
Jul 31, 2026
Merged

feat(order-book): night-contrast refresh + selective glow on offer cards#257
grunch merged 3 commits into
mainfrom
feat/order-book-night-contrast

Conversation

@grunch

@grunch grunch commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

Applies the "Card Contrast Options" mock (option 06 combined with 07's selective glow) to the redesigned Order Book palette and offer card. The previous palette had the page background and the cards too close together, so cards read as flat regions rather than surfaces.

  • Palette — darker page background (#0F151C#080B0F), lighter cards (#1A2029#232C38), and a 9% white hairline (was 6%) on every card. textTertiary and red are renudged so they still pass WCAG AA (4.5:1) on the new surfaces.
  • New tokensglowBorder + glowRing (dark and light) for the one card per screen that is selected or needs action.
  • OrderListItem.highlighted — opt-in flag. The glow ring lives on an outer DecoratedBox because Material shapes clip shadows; the border rides the Material shape so InkWell still clips to it.
  • Skeleton card — carries the same hairline so the loading state matches the loaded one.

The highlighted flag has no production caller yet — it is the API the screen will use once "selected / action-required" is wired up. Callers must set it on at most one card per screen; if every card glows, none stands out (documented on the field).

Test plan

  • flutter analyze — no issues
  • flutter test test/features/home/ — 15/15 pass
  • Goldens regenerated (order_list_item_{dark,light}.png); the gallery now highlights its first card, so the pair covers both the glow ring and the plain hairline
  • Visual check on device — dark and light

Notes for reviewers

Contrast ratios quoted in the palette comments were recomputed against the new card color, not carried over from the old one.

🤖 Generated with Claude Code

https://claude.ai/code/session_013XEubHaijWuTv8vzTk8TZZ

Summary by CodeRabbit

  • New Features
    • Added visual highlighting for selected order cards with a green glow and border.
    • Introduced refined order book surfaces, including a dedicated well background and improved card styling.
  • Style
    • Updated light and dark palette colors, shadows, borders, and card corner radii.
    • Improved filter pill contrast and order-list presentation across screen sizes.
    • Updated loading skeletons with matching rounded corners, borders, and shadows.
  • Bug Fixes
    • Improved text contrast on empty and error-state order book surfaces.

Applies the "Card Contrast Options" mock (option 06 combined with 07's
selective glow) to the redesigned Order Book palette and offer card.

- Palette: darker page background (#080B0F), lighter cards (#232C38),
  9% white hairline on every card, textTertiary/red renudged to keep
  WCAG AA (4.5:1) on the new surfaces.
- New glowBorder + glowRing tokens (dark and light) for the one card per
  screen that is selected or needs action.
- OrderListItem gains an opt-in `highlighted` flag: glow ring on an outer
  DecoratedBox (Material shapes clip shadows) and the border on the
  Material shape so InkWell still clips to it.
- Skeleton card carries the same hairline so it matches the loaded state.
- Goldens regenerated; the gallery now highlights its first card, so the
  pair covers both the glow and the plain hairline.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The change adds palette tokens for order-book wells, glows, and shadows. It applies the tokens to home-screen surfaces, order cards, and skeletons. It adds highlighted-card support and updates contrast and golden tests.

Changes

Order book styling

Layer / File(s) Summary
Palette surface and glow tokens
lib/core/app_theme.dart
OrderBookPalette now exposes well, glow, and card-shadow values. Dark and light palettes use the revised surface and color definitions.
Home screen surface integration
lib/features/home/screens/home_screen.dart
The filter pill uses bgElevated, and the order-book content uses bgWell. Existing responsive and data-state flows remain unchanged.
Card highlighting and validation
lib/features/home/widgets/order_list_item.dart, lib/shared/widgets/order_list_skeleton.dart, test/core/order_book_palette_contrast_test.dart, test/features/home/order_list_item_golden_test.dart
OrderListItem supports highlighted cards with glow styling. Cards and skeletons use updated radius, borders, and shadows. Contrast and golden coverage reflects the new surfaces.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • MostroP2P/app#243: Directly precedes these palette, home screen, card, skeleton, and contrast-test refinements.

Suggested reviewers: andreadiazcorreia

Poem

A rabbit finds the cards aglow,
Green rings shine where highlights show.
Wells grow soft beneath the list,
Shadows settle, edges twist.
Tests check colors, bright and true.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: the night-contrast refresh and selective glow for offer cards.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/order-book-night-contrast

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ad70fe09a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

padding: const EdgeInsets.fromLTRB(14, 12, 14, 14),
decoration: BoxDecoration(
color: pal.bgCard,
border: Border.all(color: pal.border),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add the hairline to the skeleton that the home screen renders

During order-book loading, HomeScreen instantiates the shared OrderListSkeleton (home_screen.dart:233-234), whose _SkeletonCard still has no border; the modified OrderListItemSkeleton here has no callers anywhere in the repository. Consequently, the production loading state never displays the new hairline and does not match the loaded cards, so the border should be added to the shared skeleton or the loading branch should use this implementation.

Useful? React with 👍 / 👎.

Replaces the night-contrast surfaces (option 06: near-black page, light
cards) with v1 mobile's exact recipe, restoring the app-wide tonal family
the rest of the screens already use:

- Palette: chrome and card share v1's backgroundDark (#171A23); new bgWell
  token (#1D212C, v1's dark1) paints the list area behind the cards, so
  cards read as darker panels floating on a lighter well. Inner panels on
  bgElevated (#1E2230), hairline down from 9% to v1's 5%.
- New cardShadow token with v1's exact depth shadow (black 70% blur 15 +
  top-edge white sheen); every card carries it now, the highlighted card
  combines it with the selective glow ring, which stays.
- Radii to v1: card 16 → 20, reputation panel 10 → 12.
- FILTER pill on bgElevated (bgCard now equals the chrome tone) and the
  skeleton shimmer back to bgCard ↔ bgElevated, visible against the well.
- Light palette follows the same structure: white cards on a #F4F4F6 well
  with a soft 12% drop shadow.
- AA contrast test extended with the bgWell pairs (empty/error state copy);
  all roles pass without re-nudging any text token. Goldens regenerated.

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/shared/widgets/order_list_skeleton.dart (1)

34-51: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Skeleton border/shadow styling landed on the wrong widget. The PR's "hairline borders on cards and skeleton cards" goal was applied to OrderListItemSkeleton, but home_screen.dart renders OrderListSkeleton_SkeletonCard during loading, and that widget did not receive the border or cardShadow. The result: the loading skeleton and the loaded card look different (no hairline border, no depth shadow on the skeleton), and there may be duplicate skeleton implementations diverging over time.

  • lib/shared/widgets/order_list_skeleton.dart#L34-L51: add border: Border.all(color: pal.border) and boxShadow: pal.cardShadow to _SkeletonCard's BoxDecoration, matching what OrderListItemSkeleton already has.
  • lib/features/home/widgets/order_list_item.dart#L349-L362: confirm whether OrderListItemSkeleton has any caller; if it is dead code, remove it instead of maintaining two divergent skeleton implementations.
🎨 Proposed fix for `_SkeletonCard`
   `@override`
   Widget build(BuildContext context) {
+    final pal = OrderBookPalette.of(context);
     return Container(
       height: _height,
       margin: const EdgeInsets.only(bottom: 12),
       decoration: BoxDecoration(
         color: Colors.white,
+        border: Border.all(color: pal.border),
         borderRadius: BorderRadius.circular(20),
+        boxShadow: pal.cardShadow,
       ),
     );
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/shared/widgets/order_list_skeleton.dart` around lines 34 - 51, Update
_SkeletonCard in lib/shared/widgets/order_list_skeleton.dart:34-51 to add the
palette border and cardShadow to its BoxDecoration, matching
OrderListItemSkeleton. In
lib/features/home/widgets/order_list_item.dart:349-362, verify whether
OrderListItemSkeleton has any callers; if unused, remove it to avoid maintaining
duplicate skeleton implementations.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@lib/shared/widgets/order_list_skeleton.dart`:
- Around line 34-51: Update _SkeletonCard in
lib/shared/widgets/order_list_skeleton.dart:34-51 to add the palette border and
cardShadow to its BoxDecoration, matching OrderListItemSkeleton. In
lib/features/home/widgets/order_list_item.dart:349-362, verify whether
OrderListItemSkeleton has any callers; if unused, remove it to avoid maintaining
duplicate skeleton implementations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ffcd8257-197c-47ba-a7d1-4770fd45929c

📥 Commits

Reviewing files that changed from the base of the PR and between 2464ade and 94805b7.

⛔ Files ignored due to path filters (2)
  • test/features/home/goldens/order_list_item_dark.png is excluded by !**/*.png
  • test/features/home/goldens/order_list_item_light.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • lib/core/app_theme.dart
  • lib/features/home/screens/home_screen.dart
  • lib/features/home/widgets/order_list_item.dart
  • lib/shared/widgets/order_list_skeleton.dart
  • test/core/order_book_palette_contrast_test.dart
  • test/features/home/order_list_item_golden_test.dart

@grunch
grunch merged commit c3f6848 into main Jul 31, 2026
4 checks passed
@grunch
grunch deleted the feat/order-book-night-contrast branch July 31, 2026 21:05
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.

2 participants