Skip to content

FLU-1311: flutter_assistant: card tool, brands, animations - #2070

Open
VelikovPetar wants to merge 8 commits into
mainfrom
claude/flutter-assistant-parity-01531d
Open

VelikovPetar wants to merge 8 commits into
mainfrom
claude/flutter-assistant-parity-01531d

Conversation

@VelikovPetar

Copy link
Copy Markdown
Contributor

Why

The Flutter assistant's restaurant cards could show tables but not book one, a brand chosen in Settings was lost on restart and didn't reach cards already on screen, and a card arriving on a call or replacing a reply's text jumped into place. The app also depended on a pre-release commit of Stream's Flutter AI components, which are now on pub.dev.

How it works

The seat selector card brings its own tool. The agent can only book a table while a card offering tables is on screen:

seat selector shown, finished streaming
  └─ AgentChat.bring(reserve_table)  -> session.addTools
       person taps a table -> agent calls reserve_table
         ├─ asks first: "Reserve this table?"
         ├─ taken or unknown table -> error naming the free ones
         └─ free table -> AgentChat.reserved(booking)
              ├─ card shows the booking and its confirmation code
              └─ AgentChat.withdraw -> session.removeTool
Change Result Test
reserve_table on the seat selector (trip_components.dart, agent_chat.dart) The agent can book a free table from the card, after the person allows it agent_chat_test.dart "a seat selector" group
Tool brought only once the card is written A table written after the first ones can still be booked seat_selector_test.dart "offers every table of a card written in pieces"
Booking shown on the card it came from The card turns into "Table T4 reserved", other cards keep their tables trip_components_test.dart
Brand kept with shared_preferences and read from the widget tree The chosen brand survives a restart, and shown cards take it on at once brand_theme_test.dart
SmoothSize around a reply and the call card Text gives way to a card smoothly, a call card slides up and grows, both instant under reduced motion smooth_size_test.dart

Changes

  • stream_chat_flutter_ai and stream_chat_flutter_ai_a2ui 0.2.0 from pub.dev in flutter_assistant, and stream_chat_flutter_ai 0.2.0 in flutter_demo, replacing the git pins and overrides.
  • Seat selector: reserve_table with approval, the booking confirmation in place of the tables, taken tables struck through and the chosen one outlined in the brand's accent.
  • Brand: persisted, A2UI buttons and controls take the brand's corners, Settings shows a swatch per brand and fits the screen.
  • Animations: a reply's text gives way to its card; on a call the card comes up from below and grows, moving the glow.
  • flutter_assistant's README rewritten for the app's current behaviour, with an Interactive UI section; flutter_demo's names the 0.2.0 package.

Validation

  • flutter analyze clean and flutter test passing in flutter_assistant (107) and flutter_demo (42); new tests also pass in random order. Each new test fails without the change it covers.
  • Run on the iOS simulator and an Android emulator against the hosted router: booking from an OpenUI and an A2UI card, the card turning into the booking, a brand switch re-theming a shown card, the brand surviving a cold restart, a card arriving on a call, and the Settings sheet.
  • flutter build apk --debug succeeds; flutter_demo answers a chat question on 0.2.0.

🤖 Generated with Claude Code

VelikovPetar and others added 6 commits November 18, 2026 10:19
Move both Flutter apps to stream_chat_flutter_ai 0.2.0 from pub.dev. The seat
selector brings reserve_table to the session and takes it back once a table is
booked, showing the booking. The call card and a reply's text giving way to
its card animate, following reduce motion. The brand is kept between launches
and shown cards re-theme live. README revised.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Settings

A seat selector shown while the agent was still writing it brought its tool
with the tables written so far, so a table written after was refused and the
card never showed the booking. Settings' brand list overflowed the sheet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Animate a reply only when its UI takes the place of its text, so streaming text
is not held back. Keep one card on a call rather than crossfading two, whose
host would drop the outgoing card's UI. Leave the call's cards without the
chat, as iOS does. Settings follows iOS: Brand, its swatches and footers, and
clear of the status bar. Strike taken tables and outline the chosen one. A
booking after the chat was let go of changes nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AnimatedSize changes its layout while laying out when it has no duration, which
Flutter asserts against, so a reply growing as it streams, or any card under
reduced motion, threw. SmoothSize follows at once with the shortest duration
instead, for the chat reply and the call card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VelikovPetar
VelikovPetar marked this pull request as ready for review November 18, 2026 12:28
@VelikovPetar VelikovPetar changed the title flutter_assistant: card tool, brands, animations FLU-1311: flutter_assistant: card tool, brands, animations Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The Flutter assistant now uses published Stream AI packages and supports card-scoped table reservations through session tools. Brand selections persist across launches and update existing cards. Chat and voice UI cards animate size changes, with reduced-motion support. The README files document package sources, interactive UI formats, reservation behavior, branding, and voice UI.

Merge Risk: Moderate · up to 1015f

Reserving tables from seat-selector cards works in the main chat flow. Before merging, fix three cases: a Stop pressed while the booking tool is being registered still sends the question; a tap can book the wrong card when table IDs repeat; and an unexpected saved brand value can stop the app from launching. Voice-call cards also show a table picker with no booking tool behind it.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

Actionable comments posted: 19

Caution

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

⚠️ Outside diff range comments (1)

Major · Launch the assistant if reading the saved brand fails. · main.dart:19

examples/voice_agents/flutter_assistant/lib/main.dart:19
Major · Stability & Availability · Quick win

Launch the assistant if reading the saved brand fails.

If SharedPreferencesAsync.getString('brand') fails, BrandProfile.load() throws before runApp. The user cannot open the app because an optional preference could not be read. Handle the read error in BrandProfile.load(). Keep the default brand on failure and still register the listener so a later selection can be saved. Continue to restore the saved brand when the read succeeds.

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8606c68 and cb936c5.

Files ignored due to path filters: 2

  • examples/voice_agents/flutter_assistant/pubspec.lock is excluded by !**/*.lock
  • examples/voice_agents/flutter_demo/pubspec.lock is excluded by !**/*.lock
Files selected for processing: 19

  • examples/voice_agents/flutter_assistant/README.md
  • examples/voice_agents/flutter_assistant/lib/agent_chat.dart
  • examples/voice_agents/flutter_assistant/lib/brand_theme.dart
  • examples/voice_agents/flutter_assistant/lib/chat_screen.dart
  • examples/voice_agents/flutter_assistant/lib/main.dart
  • examples/voice_agents/flutter_assistant/lib/settings.dart
  • examples/voice_agents/flutter_assistant/lib/smooth_size.dart
  • examples/voice_agents/flutter_assistant/lib/trip_components.dart
  • examples/voice_agents/flutter_assistant/lib/voice_screen.dart
  • examples/voice_agents/flutter_assistant/pubspec.yaml
  • examples/voice_agents/flutter_assistant/test/agent_chat_test.dart
  • examples/voice_agents/flutter_assistant/test/brand_theme_test.dart
  • examples/voice_agents/flutter_assistant/test/seat_selector_test.dart
  • examples/voice_agents/flutter_assistant/test/smooth_size_test.dart
  • examples/voice_agents/flutter_assistant/test/support/fake_sessions.dart
  • examples/voice_agents/flutter_assistant/test/support/ui_message.dart
  • examples/voice_agents/flutter_assistant/test/trip_components_test.dart
  • examples/voice_agents/flutter_demo/README.md
  • examples/voice_agents/flutter_demo/pubspec.yaml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment on lines +480 to +481
_brought.remove(tool.name);
if (!_closed) _failure.value = '$error';

@coderabbitai coderabbitai Bot Nov 18, 2026 •

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.

Major · Functional Correctness · Quick win

Give the displayed card a way to retry registration.

If a transient network failure prevents the registration POST from reaching the router, clearing _brought permits a retry but does not start one. The completed card stays mounted and interactive, and the error banner offers no retry for this failure. Expose the failed registration to the card and let the user retry before enabling table selection. A successful registration should still require only one POST.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 1015f8c. Tapping a table offers the card again, which adds the tool again when adding it failed, and the question waits for it. Covered by "adds the card's tool again when a table is tapped after adding it failed".

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.

Analysis chain

Script executed:

#!/bin/bash
set -u
for f in AGENTS.md examples/AGENTS.md examples/voice_agents/AGENTS.md examples/voice_agents/flutter_assistant/AGENTS.md examples/voice_agents/flutter_assistant/lib/AGENTS.md examples/voice_agents/flutter_assistant/test/AGENTS.md; do
  if [ -f "$f" ]; then
    printf '\n--- %s ---\n' "$f"
    cat -n "$f"
  fi
done
printf '\n--- source outlines ---\n'
ast-grep outline examples/voice_agents/flutter_assistant/lib/trip_components.dart --items all --match 'SeatSelector|offer|select' 2>/dev/null || true
ast-grep outline examples/voice_agents/flutter_assistant/test/seat_selector_test.dart --items all 2>/dev/null || true
printf '\n--- relevant source contexts ---\n'
rg -n -C 15 'chat\.offer|\.offer\(|onSelected|onPressed|_offer' examples/voice_agents/flutter_assistant/lib/trip_components.dart
printf '\n--- retry test contexts ---\n'
rg -n -C 28 "adds the card.s tool again|adding it failed|registration|adding.*failed|pending" examples/voice_agents/flutter_assistant/test/seat_selector_test.dart
printf '\n--- agent registration and dispatch ---\n'
rg -n -C 6 'await _adding|Future<void> bring|Future<void> _add|void offer\(' examples/voice_agents/flutter_assistant/lib/agent_chat.dart

Length of output: 28401


Script executed:

#!/bin/bash
printf '%s\n' '--- table action source ---'
cat -n examples/voice_agents/flutter_assistant/lib/trip_components.dart | sed -n '640,810p'
printf '%s\n' '--- test setup and retry ---'
cat -n examples/voice_agents/flutter_assistant/test/seat_selector_test.dart | sed -n '1,150p'
cat -n examples/voice_agents/flutter_assistant/test/seat_selector_test.dart | sed -n '245,290p'
printf '%s\n' '--- find SDK registration implementation ---'
rg -n -C 5 --type dart 'Future<[^>]*>\s+addTools\s*\(|addTools\s*\(' sdks/dart

Length of output: 35103


@VelikovPetar The retry covers a tap after registration has failed. One case remains: if the user taps while registration is pending and it then fails, _add catches the error and _answer still sends the action (agent_chat.dart, Line 440 and Line 494). The same can happen if the retry fails.

Prevent the action from being sent when registration fails, and let the user retry. Add tests for both failure cases. I am not marking the finding as addressed.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

final preferences = SharedPreferencesAsync();
final stored = await preferences.getString(_storageKey);
active.value = values.asNameMap()[stored] ?? active.value;
active.addListener(() => preferences.setString(_storageKey, active.value.name));

@coderabbitai coderabbitai Bot Nov 18, 2026 •

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.

Minor · Data Integrity & Integration · Quick win

Handle failed brand writes.

If Android cannot commit an Ember selection, Settings still marks Ember as selected and the cards already use it. The listener discards the failed setString Future. Tapping Ember again does not trigger another write, and the next launch can restore the previously saved brand. Keep the live preview, but handle the write result and let the user retry the same selection. (raw.githubusercontent.com)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 1015f8c: a failed save is caught and logged instead of surfacing as an unhandled error. No retry: the brand is a local preference and the live preview already applies.

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.

@VelikovPetar The save failure is now logged. I accept the decision not to add a retry. I am not marking the finding as addressed because the original request included a retry.


Learnings added

Learnt from: VelikovPetar
Repo: GetStream/Agents PR: 2070
File: examples/voice_agents/flutter_assistant/lib/brand_theme.dart:0-0
Timestamp: 2026-11-18T13:40:29.790Z
Learning: Within repository "GetStream/Agents", only for files matching one of ["examples/voice_agents/flutter_assistant/lib/brand_theme.dart"]: In examples/voice_agents/flutter_assistant/lib/brand_theme.dart, the author accepts logging a failed brand-preference save without adding a retry because the preference is local and the live preview remains applied. A failed save can leave the previous brand stored for the next launch. Do not repeat the retry-only request without new context.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

group('BrandProfile', () {
test('load restores the brand chosen at an earlier launch and keeps the next one', () async {
final store = InMemorySharedPreferencesAsync.withData({'brand': 'nordic'});
SharedPreferencesAsyncPlatform.instance = store;

@coderabbitai coderabbitai Bot Nov 18, 2026 •

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.

Minor · Maintainability & Code Quality · Quick win

Remove the persistence fixture after this test.

If this test runs first, BrandProfile.load() leaves a listener that retains its fake store. The widget test then writes to that store when it selects Ember. Resetting active does not remove the listener and can trigger another write. Detach the persistence listener before resetting active, and restore the previous SharedPreferencesAsyncPlatform.instance. Restoring the platform instance alone does not release the store captured by the listener. (raw.githubusercontent.com)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Leaving as is: each test file runs in its own isolate, and the other test in this file resets the brand in tearDown, so the listener cannot reach another test.

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.

Analysis chain

Script executed:

#!/bin/bash
for file in examples/voice_agents/flutter_assistant/lib/brand_theme.dart examples/voice_agents/flutter_assistant/test/brand_theme_test.dart; do
  echo "=== Outline: $file ==="
  ast-grep outline "$file" --items all || true
  echo "=== Source: $file ==="
  cat -n "$file" | sed -n '1,220p'
done
echo "=== Applicable repository instructions ==="
for file in AGENTS.md examples/AGENTS.md examples/voice_agents/AGENTS.md examples/voice_agents/flutter_assistant/AGENTS.md examples/voice_agents/flutter_assistant/test/AGENTS.md; do
  if [ -f "$file" ]; then
    echo "--- $file ---"
    rg -n -i -C 3 'resolv|review.thread|review comment' "$file" || true
  fi
done

Length of output: 11349


@VelikovPetar Understood. I’ll leave the change as-is.

One correction: tearDown resets the brand but does not remove the listener. Later tests in the same file can still trigger it. I won’t mark the finding as addressed.

You are interacting with an AI system.

VelikovPetar and others added 2 commits November 18, 2026 13:42
The app opens with the default brand when the saved one can't be read. The call
card's slide no longer adds a listener each time a streaming card rebuilds. The
seat selector test proves a card still being written brings no tool, and the
booking test that the booked card stops offering its tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A second card offering other tables couldn't be booked, two venues with the same
table ids shared a booking, and booking one card cleared another's. Each card now
offers its tables by the reply it is in, and keeps its own booking; the tool is
taken back once every card is booked, and kept until the router lets it go.

A question waits for a card's tool still being added, tapping a table adds it
again if adding it failed, the tool refuses a summary that doesn't name the table
being booked, and a brand that can't be saved is logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VelikovPetar

Copy link
Copy Markdown
Contributor Author

@coderabbitai On the outside-diff finding (main.dart:19, launching when the saved brand can't be read): fixed in 039d940. BrandProfile.load keeps the default brand when the read fails and still saves later choices; covered by brand_theme_test.dart "load opens with the default brand when the saved one cannot be read, and keeps the next".

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

Actionable comments posted: 12

Additional comments: 1

examples/voice_agents/flutter_assistant/lib/agent_chat.dart-520-520: 1

520-520: Major · Data Integrity & Integration · Heavy lift

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Retire offers when their source reply is deleted.

If a reply offering T1 is deleted, the feed hides the reply but _offers still accepts bookings for T1. The stale offer also prevents tool withdrawal when the remaining card is booked. Remove the offer when its source is deleted or no longer contains the selector. Do not remove it just because the user scrolls it off screen. (raw.githubusercontent.com)

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between cb936c5 and 1015f8c.

Files selected for processing: 10

  • examples/voice_agents/flutter_assistant/README.md
  • examples/voice_agents/flutter_assistant/lib/agent_chat.dart
  • examples/voice_agents/flutter_assistant/lib/brand_theme.dart
  • examples/voice_agents/flutter_assistant/lib/trip_components.dart
  • examples/voice_agents/flutter_assistant/lib/voice_screen.dart
  • examples/voice_agents/flutter_assistant/test/agent_chat_test.dart
  • examples/voice_agents/flutter_assistant/test/brand_theme_test.dart
  • examples/voice_agents/flutter_assistant/test/seat_selector_test.dart
  • examples/voice_agents/flutter_assistant/test/support/fake_sessions.dart
  • examples/voice_agents/flutter_assistant/test/trip_components_test.dart
Files skipped from review as they are similar to previous changes: 1

  • examples/voice_agents/flutter_assistant/README.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

_checkNotStopped(stops, request);
// Only now, so a new conversation whose first question was never asked is not listed.
_usedSessionId.value = session.id;
await _adding;

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.

Major · Functional Correctness · Quick win

Recheck cancellation after tool registration.

If the user presses Stop while _adding is pending, send still calls responses.create when registration finishes. It interrupts only after the router receives the request. A close during the wait also does not prevent the POST. Move the wait before the final _checkNotStopped and _usedSessionId assignment. A stopped request should return to the composer without reaching the router. (raw.githubusercontent.com)

_failure.value = null;
try {
final session = await use();
await _adding;

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.

Minor · Functional Correctness · Quick win

Do not send a card action after the chat closes.

If the user leaves while _answer waits for _adding, the method still attempts the response POST for the old chat. The catch can hide a rejection, but it cannot prevent the request. Check _closed immediately after the wait. (raw.githubusercontent.com)

/// could not be taken back is taken back the next time this is asked.
Future<void> withdraw(String name) async {
final session = _session;
if (session == null || _closed || !_brought.contains(name)) return;

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.

Major · Data Integrity & Integration · Heavy lift

Do not treat an unconfirmed DELETE as an installed tool.

If the router removes reserve_table but its reply is lost, the SDK marks the removal unsettled. _brought still makes bring skip registration for every new card and every retry tap. Track this outcome separately from confirmed installation. On the next offer, let addTools use the SDK's existing reconciliation path. (raw.githubusercontent.com)

Comment on lines +507 to +510
if (session == null || _closed || !_brought.contains(name)) return;
try {
await session.removeTool(name);
_brought.remove(name);

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.

Major · Stability & Availability · Heavy lift

Reconcile new offers with a pending withdrawal.

If booking A starts a DELETE and B appears before it completes, B's registration is skipped because _brought still contains reserve_table. Tapping B in that window also skips registration. If the DELETE takes effect before the next turn starts, that turn has no booking tool. Track the pending removal and make B's request wait for registration after the removal settles. Do not re-add the tool if no unbooked offer remains. (raw.githubusercontent.com)

Comment on lines +533 to +535
for (final MapEntry(key: offer, value: tables) in _offers.entries.toList().reversed) {
if (booked.containsKey(offer)) continue;
final table = tables.where((t) => t.id == tableId && t.available).firstOrNull;

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.

Major · Data Integrity & Integration · Heavy lift

Book the offer the user selected.

If Terrace and a newer Garden card both offer T1, tapping Terrace can book Garden. The action identifies the originating reply, but reserve receives only the table ID and picks the newest match. Even a summary that correctly says Terrace does not change that lookup. Carry the offer identity through to reserve and reject a stale or unavailable selection instead of booking another venue. (raw.githubusercontent.com)

Comment on lines +803 to +804
final chat = AgentChatScope.maybeOf(context);
if (chat == null || identical(chat, _chat)) return;

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.

Major · Functional Correctness · Heavy lift

Voice seat selectors present booking without a way to book.

On a voice call, the seat selector renders without AgentChatScope. Its offer and reserve_table registration run only when a chat scope is present (trip_components.dart:803-804). A table tap on a voice selector can therefore reach the agent with no booking tool or approval available.

Make the voice behavior match one of two options:

  • Register the booking flow for voice sessions, so a completed voice seat selector offers the same approval-based booking as a chat card.
  • Do not present the picker as bookable on voice cards.

await offer(chat);
chat.offer('m1', tables);

expect(sessions.routes.where((r) => r == tools), hasLength(1));

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.

Minor · Functional Correctness · Quick win

Wait for the repeat offer before counting registration requests.

This assertion runs immediately after the second chat.offer. If the duplicate guard is removed, the SDK queues another add, but the second POST cannot reach the fake router before this assertion. The test still sees one request. Await completion of the second offer's registration work before checking the request count. (raw.githubusercontent.com)

As per path instructions, flag “tests that would still pass on a broken implementation.”

Source: Path instructions


BrandProfile.active.value = BrandProfile.ember;
// The save's failure would surface here, as an error nobody handled.
await Future<void>.delayed(const Duration(milliseconds: 50));

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.

Minor · Functional Correctness · Quick win

Assert that the write-failure test attempts a save.

The test passes after 50 ms even if the Ember selection never calls _UnwritableStore.setString. Record the key and value in the fake before it throws. Wait for that signal with a timeout and assert that the test attempted to save brand=ember. Keep the test harness check for unhandled errors.

As per path instructions, flag “tests that would still pass on a broken implementation.”

Source: Path instructions

Comment on lines +218 to +220
final result = await call(tester, 'T7');

expect(result['output'], contains('Reserved table T7'));

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.

Minor · Functional Correctness · Quick win

Assert that the rewrite makes T1 unbookable.

This test passes if a rewrite adds T7 but leaves the old, available T1 in the booking lookup. Attempt T1 first and assert rejection without a confirmation. Then book T7 as the test does now. Checking T1 after booking T7 would let the booked-card guard hide stale availability.

As per path instructions, flag “tests that would still pass on a broken implementation.”

Source: Path instructions

await show(tester, [
_card('m1', [('T1', 'Cliff Terrace', 2, true), ('T4', 'Harbor Window', 4, true)]),
]);
await settle(tester, brought, 'The card never brought its tool.');

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.

Minor · Functional Correctness · Quick win

Wait for the registration failure before tapping to retry.

brought proves only that the fake router received the POST. If the tap runs before _add processes the 500 and clears _brought, the app correctly skips a concurrent add and the test times out waiting for a second POST. Wait for chat.failure to report the first add error before changing the response and tapping. (raw.githubusercontent.com)

@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

Analysis chain

Script executed:

#!/bin/bash
set -u
printf '%s\n' '=== Matching files ==='
fd -t f -g 'main.dart' examples/voice_agents/flutter_assistant/lib
fd -t f -g 'brand_theme.dart' examples/voice_agents/flutter_assistant/lib
fd -t f -g 'brand_theme_test.dart' examples/voice_agents/flutter_assistant/test

for file in \
  examples/voice_agents/flutter_assistant/lib/main.dart \
  examples/voice_agents/flutter_assistant/lib/brand_theme.dart \
  examples/voice_agents/flutter_assistant/test/brand_theme_test.dart
do
  printf '\n=== Outline: %s ===\n' "$file"
  ast-grep outline "$file" --items all 2>&1 || true
  printf '\n=== Contents: %s ===\n' "$file"
  cat -n "$file"
done

printf '\n=== Reported commit ===\n'
git show --stat --oneline 039d94051 -- \
  examples/voice_agents/flutter_assistant/lib/main.dart \
  examples/voice_agents/flutter_assistant/lib/brand_theme.dart \
  examples/voice_agents/flutter_assistant/test/brand_theme_test.dart 2>&1 || true
if git merge-base --is-ancestor 039d94051 HEAD 2>/dev/null; then
  echo 'Reported commit is an ancestor of HEAD.'
else
  echo 'Reported commit ancestry could not be established from this checkout.'
fi

Length of output: 21504


@VelikovPetar I checked commit 039d94051. BrandProfile.load catches read-time PlatformExceptions and still registers the save listener. The cited test covers the fallback and a later save.

I did not run the test.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant