Repository navigation
feat(ui): add onLongPress to StreamButton - #210
Conversation
StreamButton and StreamButton.icon take an onLongPress callback, which also gives the button a long-press action for accessibility services. While it is set, a long press calls it instead of showing the icon button's tooltip; the tooltip still shows on hover. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Add and validate the long-press API packages/stream_core_flutter/lib/src/components/buttons/stream_button.dart, packages/stream_core_flutter/test/components/buttons/stream_button_test.dart, packages/stream_core_flutter/CHANGELOG.md |
Both constructors and StreamButtonProps now support onLongPress. The callback is passed to ElevatedButton. Tooltip triggering is manual when the callback is set. Tests cover long-press behavior, semantics, and tap behavior. The changelog records the addition. |
Configure long press in the gallery apps/design_system_gallery/lib/components/buttons/button.dart |
The playground adds a Long Press control and passes a callback to icon-only and labeled buttons when enabled and not disabled. The callback displays a message for one second. |
Priority:
Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant User
participant Playground
participant StreamButton
participant ElevatedButton
participant showMessage
User->>ElevatedButton: Long-press the button
ElevatedButton->>StreamButton: Invoke onLongPress callback
StreamButton->>Playground: Invoke configured callback
Playground->>showMessage: Display long-press message
Suggested reviewers: renefloor
Merge Risk: 
Minimal · previous review a9a9d
-
Long-press support appears ready to merge after normal checks.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title "feat(ui): add onLongPress to StreamButton" matches the main change. The changeset adds an optional onLongPress callback to StreamButton, StreamButton.icon, and StreamButtonProps, passes it to the underlying ElevatedButton, and suppresses the tooltip trigger on long press. The title is specific, short, and in a conventional commit format.
Full details: Description check
-
Explanation
The description follows the repository template. It has a "What changed" section that describes the onLongPress API, the tooltip and accessibility behavior, and the gallery knob. It has a "Why" section that links the chat SDK use case. It has a "Verification" section that lists widget tests and flutter analyze results. The template's Linear ticket field, CLA checklist, Github Issue field, and Screenshots/Videos table are not present. The author does not provide a Linear ticket or a screenshot of the gallery knob or the long-press behavior.
Resolution
Add the Linear ticket reference (FLU-...) or confirm that it is not applicable. Optionally link a GitHub issue in the Github Issue field. Complete or confirm the CLA checklist items. Add a Screenshots / Videos entry, or state why one is not needed. The description is otherwise complete.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (4 skipped: 4 unsupported.)
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- 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.
Comment @coderabbitai help to get the list of available commands.
Use Flutter's wording for onPressed and onLongPress, and wrap the icon button in a plain Tooltip as Flutter's buttons do: a long press still calls onLongPress instead of showing the tooltip. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #210 +/- ##
==========================================
+ Coverage 71.98% 71.99% +0.01%
==========================================
Files 216 216
Lines 9066 9067 +1
==========================================
+ Hits 6526 6528 +2
+ Misses 2540 2539 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What changed
StreamButtonandStreamButton.icontake anonLongPresscallback (also onStreamButtonProps), passed to the underlying button.onLongPressis set, a long press calls it instead of showing the icon button's tooltip; the tooltip still shows on hover.Semantics(onLongPressHint: …).StreamButtonplayground.Why
The chat SDK's composer needs a long press on the send button to offer scheduling a message (GetStream/stream-chat-flutter#3138 and the UI PR stacked on it).
Verification
onLongPressand doesn't show the tooltip, a tap still callsonPressed, and the semantics node has the long-press action.flutter analyzeclean on the package and the gallery.🤖 Generated with Claude Code
Summary by CodeRabbit