Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,42 @@ itself is for. If a `group` is doing the work a separate file should be doing,
[split the file instead](STYLE_GUIDE.md#prefer-more-test-files-avoid-long-test-files).
Nested groups more than one level deep are almost always a signal to split.

## A failing golden on a local run is not necessarily a regression

Committed goldens are always generated on CI, so they encode that host's font
hinting and antialiasing. A local `flutter test` renders differently, and will
report golden failures that have nothing to do with your change. Never conclude
"my change broke these goldens" from a local run alone, and never conclude the
opposite either — that a green local run means you changed nothing visually.

To find out what your change actually affected, compare **two local runs** instead
of comparing against the committed PNGs:

```bash
# 1. with your change reverted (git stash), regenerate and keep a copy
GITHUB_ACTIONS=true flutter test --update-goldens
cp -R <goldens/ci dirs> /tmp/baseline/

# 2. restore your change, regenerate again, and diff the two sets
GITHUB_ACTIONS=true flutter test --update-goldens
```
Comment on lines +216 to +222

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the baseline comparison executable.

Line 216 mentions git stash, but the code block does not run it. Line 220 says to restore the change, but it does not show git stash pop. If readers follow these commands as written, both runs can use the same revision and the comparison cannot isolate the PR change. Add explicit stash, restore, and comparison commands.

🤖 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 `@TESTING.md` around lines 216 - 222, Update the documented golden baseline
workflow in TESTING.md to explicitly stash the change before the first test run,
restore it with git stash pop before the second run, and include a command that
compares the baseline and regenerated golden directories. Keep the existing test
commands and paths aligned with the two-revision comparison.


Whatever differs between the two sets is genuinely yours; everything else is host
drift. Amplifying the pixel diff (e.g. with PIL) makes a subtle change easy to
confirm.

Two things that make this easy to get wrong:

- Only `goldens/ci/` is committed — `goldens/<platform>/` is gitignored. A local
run silently rewrites the platform goldens and `git status` stays clean, so an
empty `git status` is not evidence that nothing changed.
- Alchemist picks CI goldens off the `GITHUB_ACTIONS` environment variable (see
`test/flutter_test_config.dart`). Without it you are exercising the gitignored
platform goldens, not the ones CI compares against.

Regenerate committed goldens with the `update_goldens` GitHub Action, never from
your machine — see [Golden tests in STYLE_GUIDE.md](STYLE_GUIDE.md#golden-tests).

## See also

- [STYLE_GUIDE.md — Testing](STYLE_GUIDE.md#testing) — repo-level testing conventions
Expand Down
1 change: 1 addition & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Fixed the attachment picker throwing a `Tooltip` assertion error when a custom `TabbedAttachmentPickerOption` is added without a `title`; the tooltip is now only shown when a title is provided.
- Fixed the `StreamBackButton` unread badge including the currently open channel in its total count.
- Fixed `StreamMessageListView` jumping several screens when selecting text in a message on desktop or web. The `ScrollablePositionedList` viewports now account for their `anchor` in `getOffsetToReveal`, so implicit reveals (`Scrollable.ensureVisible`, `RenderObject.showOnScreen`) no longer overshoot. [#2862](https://github.com/GetStream/stream-chat-flutter/issues/2862)
- Fixed modal dialogs (message actions, delete/flag confirmation) rendering over a white scrim in light theme; they now use the design system's scrim token.

## 10.2.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Future<T?> showStreamDialog<T>({
routeSettings: routeSettings,
transitionDuration: transitionDuration,
barrierDismissible: barrierDismissible,
barrierColor: barrierColor ?? colorScheme.backgroundOverlayLight,
barrierColor: barrierColor ?? colorScheme.backgroundScrim,
barrierLabel: barrierLabel ?? localizations.modalBarrierDismissLabel,
transitionBuilder: (context, animation, secondaryAnimation, child) {
final sigma = 10 * animation.value;
Expand Down
Loading