ueman / feedback

A simple widget for getting better feedback.
https://pub.dev/packages/feedback
378 stars 92 forks source link

feature: Add option supportedModes #276

Open defuncart opened 4 months ago

defuncart commented 4 months ago

: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

:crystal_ball: Next steps

defuncart commented 4 months ago

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

ueman commented 4 months ago

Hey, thanks for the contribution. The API seems perfectly fine for me. Thanks for working on it.

codecov[bot] commented 4 months ago

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