-
Notifications
You must be signed in to change notification settings - Fork 856
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
Feat: support for dynamic placeholders #2238
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this.
Please refer to Flutter Documentation style. Most of the old / original / legacy codebase, most packages and projects follow this style.
Documentation is important, I prefer if feature X doesn't exist if it could have poor documentation, and it's one of the main reasons we don't understand most of the codebase. I haven't done it in a good way previously but the goal is to improve the new changes.
/// so, we only need to configure `placeholderComponentsConfiguration` like: | ||
/// | ||
///```dart | ||
///final configuration = PlaceholderComponentsConfiguration( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not formatted properly, formatting is important for consistent codebase docs, and handling conflicts, not necessarily for the final output.
The general idea is to follow the Dart and Flutter style for writing docs. The lints and checks will be updated later.
/// Whether the line is empty, this let us add a placeholder | ||
/// | ||
/// _Note: these placeholders are limited only to lines with block styles_ | ||
/// | ||
/// ### Example | ||
/// | ||
/// Assume that you want to show only a placeholder text for the header items, | ||
/// so, we only need to configure `placeholderComponentsConfiguration` like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the Flutter/Dart style for writing docs (see example doc comment).
Try to remove the redundancy, keeping it as short as possible without details loss (not necessarily short), avoid let us
, assume that you want to ...
, we
, you
, and our
in docs.
While our current doc comments are not qualified enough, I would like to improve, not add more things to improve on the list. I will update this soon, currently, I'm fixing #2394 and other related issues in flutter_quill_extensions
(broken behavior on desktop and web platforms), once I'm done, I will handle all of the nits soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't focused on improving the documentation yet. As you said before, I will follow the documentation style you mentioned, however, my priority at the moment is to check that all the functionality is working as it should. Once I can see that everything is working correctly, I will take the time to create more documentation (not only adding doc comments but also adding files for the official documentation of the package)
lib/src/editor/raw_editor/builders/placeholder/placeholder_builder_internal.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/raw_editor/builders/placeholder/placeholder_builder_internal.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/raw_editor/builders/placeholder/placeholder_builder_internal.dart
Outdated
Show resolved
Hide resolved
lib/src/editor/widgets/cursor.dart
Outdated
} | ||
|
||
bool _isNodeInline(Line node) { | ||
for (final attr in node.style.attributes.values) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Responding to a comment: Let's keep it for now, this is a separate issue and there is already much to do on our list.
lib/src/editor/widgets/cursor_configuration/cursor_configuration.dart
Outdated
Show resolved
Hide resolved
…for cursorPlaceholderConfig.offset in paint method
I appreciate your contributions, but please consider creating issues before working on them because I'm not with the idea of adding this feature or any new similar features. The editor is just not stable. It was much better before, and so far, we haven't addressed many regressions affecting production apps. Users have already started to migrate away from the project and use alternatives. See #2445 issue as one of mant examples, they are also many major bugs that aren't being reported. Adding new features that cause issues will require others to take responsibility for maintaining them. We don't have enough tests, and we have already discussed this many times. I prefer stability, especially with the current state, even if the progress is slower. If we can't fix the current issues, then it's better not to make the project any less stable. I will create one issue for such discussions because I don't want to repeat it everywhere. @singerdmx Adding features that we're not certain about, then fixing them later once users start reporting them comes at a high price. |
@EchoEllet I didn't plan on adding this feature at the moment. I just wanted to verify that everything was in order and finish the changes. I have the same opinion on this point, I would prefer this feature to be merged after solving most of the bugs we have at the moment. @singerdmx by now, i would prefer that this PR remain unmerged for now, and wait for a much more stable version without so many issues of the project. |
There is no ETA for a more stable version. Last year, we discussed this, and it's seems everyone excited and has high expectations, but all that happens is that the magnifier was introduced with many major bugs and fixed yesterday after many months, which simply makes the experience similar or even less stable than before.
Some users are using older versions and sticking to them due to such issues, and this is not the kind of developer and user experience I'm looking forward to. And because of that, we're not certain if this PR will ever get merged, which is why I suggest creating issues for future PRs. I'm mainly concerned we end up closing many PRs that would discourage contributors with the time they have already spent. |
I will close the PR as not only are we not in a position to add new features at the moment, but it will also likely be a long time before it is even merged into the stable branch. |
Description
Added
placeholderConfig
parameter to allow us to build placeholders dynamically depending on what attribute we want andcursorPlaceholderConfig
that allows to the devs add a placeholder at the right (if we are using a LTR language) of the cursor (only when the paragraph and it does not contains any block attribute or selection)For example, if we only want to display placeholders for
Headers
andLists
, then we would set it up like this:Preview
Web
test_web_placeholders.mp4
Desktop
desktop_placeholders.mp4
Android
fixed_text_scale.mp4
Related Issues
N/A
TODO