feedback
feedback copied to clipboard
feature: Add option supportedModes
:scroll: Description
Adds the option to define supportedModes so that, for instance, FeedbackMode.navigate is not displayed.
:bulb: Motivation and Context
For a single page desktop application, the navigate option may not be required. Moreover, the user can continue to interact with the application as usual (i.e. right click), thus there can be cases where we do not want to allow the user to interact while the feedback window is open.
Conversely, I am not sure if there are real-world use-cases where the user can interact/navigate but not draw, nevertheless those would be covered by this PR.
:green_heart: How did you test it?
Update example/lib/main.dart, change supportedModes accordingly.
Technically the user can select
mode: FeedbackMode.draw,
supportedModes: const [FeedbackMode.navigate],
which is non-sensical. A check in FeedbackWidget ensures correct state, however the api could be updated, i.e. first value of supportedModes.
Moreover, assets/errors could be raised when supportedModes is empty;
:pencil: Checklist
- [X] I reviewed submitted code
- [ ] I added tests to verify changes
- [ ] I updated the docs if needed
- [ ] All tests passing
- [X] No breaking changes
:crystal_ball: Next steps
FeedbackMode.navigateperhaps needs a renaming tointeractive. This, perhaps, could be more descriptive. Such a change, however, would be a breaking change best suited to another PR.modewas left as-is to not introduce any breaking changes (see discussion above).
@ueman Thanks for creating this package :) Please review API and let me know what you think. Once API is approved, appropriate tests can be added.
Hey, thanks for the contribution. The API seems perfectly fine for me. Thanks for working on it.
Codecov Report
Attention: Patch coverage is 96.29630% with 1 lines in your changes are missing coverage. Please review.
Project coverage is 83.77%. Comparing base (
471cc7b) to head (df234c7). Report is 3 commits behind head on master.
| Files | Patch % | Lines |
|---|---|---|
| feedback/lib/src/feedback_widget.dart | 66.66% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #276 +/- ##
==========================================
- Coverage 83.77% 83.77% -0.01%
==========================================
Files 20 20
Lines 635 641 +6
==========================================
+ Hits 532 537 +5
- Misses 103 104 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.