-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
bevy_text::input
module
#20336
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
Open
ickshonpe
wants to merge
60
commits into
bevyengine:main
Choose a base branch
from
ickshonpe:bevy-text-input
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,986
−7
Open
bevy_text::input
module
#20336
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
edc879c
Added `input` module to `bevy_text` with systems and components to su…
ickshonpe f36f9d0
use `is_empty()` instead of checking lengeth is 0
ickshonpe 771477c
Renamings:
ickshonpe 11074c0
Renamed `TextInputPasswordMask` to `PasswordMask`
ickshonpe f991426
Updated comments including suggestions from review
ickshonpe 62ca2f8
Added a `TextEdit::InsertString` variant. Use to insert a string at …
ickshonpe 308d0c9
Renamed `appy_text_input_action` to `apply_text_edit`
ickshonpe 158f329
Updated `TextInputValue`'s comments to explain that it is synchronise…
ickshonpe a7d5e45
Expanded the doc comments for `TextInputAttributes`.
ickshonpe 785a1d5
Renamed `TextInputUndoHistory` to `UndoHistory`
ickshonpe f637123
Merge branch 'main' into bevy-text-input
ickshonpe b4589b8
Updated buffer's docs and added a `needs_redraw` function.
ickshonpe 8e61105
Updated the doc comments for `apply_text_edits`
ickshonpe ede9d60
updated another doc comment
ickshonpe a80a5dc
More doc comments
ickshonpe 0b2c268
Edited the doc comment for apply_text_edits
ickshonpe 93149bc
More comment edits
ickshonpe 049e350
Renamed `Prompt` to `Placeholder` and also updated the comments and t…
ickshonpe 3e9c860
Fixed renaming.
ickshonpe 5c956c6
Rephrased doc comment.
ickshonpe 6396a11
Spellings.
ickshonpe 5d34e6d
Renamed the `InvalidInput` and `ValueChanged` `TextInputEvent` varian…
ickshonpe 57a70cd
Fixed event dispatch.
ickshonpe 85bed33
Added release note
ickshonpe f43c461
Added migration note for `load_font_to_fontdb` function changes.
ickshonpe 0b6b1d2
Update release note
ickshonpe 897d741
Merge branch 'main' into bevy-text-input
ickshonpe 2bd0216
Update crates/bevy_text/src/input.rs
ickshonpe 255d2c1
Update crates/bevy_text/src/input.rs
ickshonpe 419bcaf
Update crates/bevy_text/src/input.rs
ickshonpe fe38cf2
Update release-content/release-notes/bevy_text_input_module.md
ickshonpe dea6616
Update crates/bevy_text/src/input.rs
ickshonpe 48475ff
FIxed comment
ickshonpe 893f9c4
Merge branch 'bevy-text-input' of https://github.com/ickshonpe/bevy i…
ickshonpe 96bacc1
Fix comments
ickshonpe 2035726
Added text input 2d example
ickshonpe a692fd8
cargo run -p build-templated-pages -- build-example-page
ickshonpe 9371313
Merge branch 'main' into bevy-text-input
alice-i-cecile 27dc3df
Merge branch 'bevy-text-input' of https://github.com/ickshonpe/bevy i…
ickshonpe 622bbe6
Added example skeleton.
ickshonpe e20e670
Merge branch 'main' into bevy-text-input
ickshonpe 307590a
Added `TextInputStyle` component.
ickshonpe 6611bde
Updated example
ickshonpe 811f0c8
Added `CursorBlinkInterval` resource
ickshonpe 2f43052
Renamed CursorBlinkInterval to TextCursorBlinkInterval.
ickshonpe acc0706
Added doc comment for resource
ickshonpe c72f7ce
Deleted style component.
ickshonpe eb15165
Fixed target size scaling.
ickshonpe 171de2f
Updated comments
ickshonpe 96e3c6e
Clean up
ickshonpe 0ba0b68
Merge branch 'main' into bevy-text-input
ickshonpe 295de7f
Fixed example imports
ickshonpe 6b3f3d8
Anchor output below input in example
ickshonpe f794658
Removed unnecessary casts
ickshonpe 00a0c13
Fixed wrong casts
ickshonpe f03a7cf
New `InvalidTextEditError`, returned by `apply_text_edit`.
ickshonpe fb73aa3
Only collect buffer text if `TextInputValue` is present.
ickshonpe 288ea3b
take just Editor'_> with is_cursor_at_end_of_line
ickshonpe 6817f5c
Added release note suggestion
ickshonpe 7ab3c19
Update crates/bevy_text/src/input.rs
ickshonpe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Okay this is an issue -
cosmic_undo_2
depends onderivative
which is unmaintained.Turns out
cosmic_undo_2
is a diverged fork fromundo_2
- just a minor change on thecosmic_undo_2
side.undo_2
has a new version withoutderivative
, but it's not published tocrates.io
Example: changing the dependency here as follows:
And changing
cosmic_undo_2
toundo_2
incrates/bevy_text/src/input.rs
, and it builds.Now the above will fail due with:
So couple of options:
Uh oh!
There was an error while loading. Please reload this page.
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.
Yep I was considering making a fork, a a new release would be ideal though. Undo is extremely desirable, so I don't think removing it is an option.
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.
A fork wouldn't be the worst thing. It's only one source file. Plop a README in the directory saying that this will go away once they publish a version.
What would be even better is if we could adapt this same library for undoing in general (in editors like the Bevy editor). There's been a ton of bikeshedding around undo/redo in editor-dev, and some of the prototypes that people have put forward are "new work" (meaning, "Undo/Redo can't be all that hard, I'll throw something together this evening"). (I'm guilty of this too, so there's shade all around.) I'd rather go with a battle-tested solution if it can meet our needs.
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.
A fork seems most desirable to me too.
Uh oh!
There was an error while loading. Please reload this page.
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.
@alice-i-cecile I have requested a reservation in bevyengine/bevy-crate-reservations#40 , forked
undo_2
to https://github.com/Zeophlite/bevy_undo_2 , I ask that this get moved to thebevyengine
org and published from thereThere 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.
ugh,
bevy-undo
already exists, maybebevy_undo_2
(as it's a fork ofundo_2
)Uh oh!
There was an error while loading. Please reload this page.
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.
If the plan is to use the canonical
undo_2
once they push a version that doesn't depend onderivative
, then this is purely a short-term fix, in which case I don't see the need for a new crate. Just paste the source file for undo_2 into a subfolder of the text input crate, and delete it later.Crates are forever (which I discovered to my sorrow with bevy_color).
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'm not fussed either way, this was mostly about creating the option. My impression was there was thoughts to further modify the library, but I may of misinterpretted that.
I've rasied https://gitlab.com/okannen/undo_2/-/issues/1 to see if it can be published to crates.io
It's nightime here, so I will leave copying into the bevy repo to someone else for now.
Note in https://github.com/ickshonpe/bevy/pull/10/commits I have some other CI fixes that could be cherry-picked.
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.
We might further modify it in the future, but as a starting point simply copying it in is fine.
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.
@alice-i-cecile I have created #20489 to upstream the library