Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Add option supportedModes #276

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

defuncart
Copy link

📜 Description

Adds the option to define supportedModes so that, for instance, FeedbackMode.navigate is not displayed.

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

💚 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;

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

  • FeedbackMode.navigate perhaps needs a renaming to interactive. This, perhaps, could be more descriptive. Such a change, however, would be a breaking change best suited to another PR.
  • mode was left as-is to not introduce any breaking changes (see discussion above).

@defuncart
Copy link
Author

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

@defuncart defuncart force-pushed the feature/option-selectable-modes branch from e8a1d2e to df234c7 Compare February 24, 2024 11:14
@defuncart defuncart marked this pull request as ready for review February 24, 2024 15:38
@ueman
Copy link
Owner

ueman commented Feb 26, 2024

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

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.

Project coverage is 83.77%. Comparing base (471cc7b) to head (df234c7).
Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
feedback/lib/src/feedback_widget.dart 66.66% 1 Missing ⚠️
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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants