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

[#62486] searching in tokens removes prefix from word #18438

Conversation

Kharonus
Copy link
Member

@Kharonus Kharonus commented Mar 25, 2025

Ticket

OP#62486
OP#62255

What are you trying to accomplish?

  • searching inside tokens now strips the prefix
  • after inserting a token, caret position is placed behind the token

What approach did you choose and why?

  • slice prefixes from input words, if word is read from any token
  • decide where to put caret dependent on the token to put the caret behind

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
- https://community.openproject.org/wp/62486
- getting the word from a token now strips the prefix
@Kharonus Kharonus requested review from brunopagno and a team March 25, 2025 14:45
@Kharonus Kharonus self-assigned this Mar 25, 2025
@Kharonus Kharonus changed the title [#62486] searching in tokens removes prefix from word] [#62486] searching in tokens removes prefix from word Mar 26, 2025
Copy link
Contributor

@NobodysNightmare NobodysNightmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one question and will now try the changes practically out in a browser.

@NobodysNightmare
Copy link
Contributor

In Firefox I can't delete tokens anymore. Neither through backspace, nor through delete:

Screencast.from.2025-03-27.11-01-39.webm

Mh, I just double checked to be sure and as far as I can tell, I already have this problem on dev :/

@NobodysNightmare
Copy link
Contributor

I tried understanding the "strip prefix" part and I think I found an off-by-one error. See me inserting a space in random places, just to see from which point the autocompletion starts:

Screencast.from.2025-03-27.11-16-45.webm

In the first word (project) it's fine, but afterwards the first character is cut off.

@Kharonus
Copy link
Member Author

Kharonus commented Mar 27, 2025

Nice catch, the off by one was introduce by changing one side, but not the other :D -> fixed

As for FF: I can't help with it. For some reason, FF jumps iniine elements with content editable, when hitting backspace. This is what chromium does better. Both have their issues with DEL, which I would indeed label as a bug, but not a critical one.

Copy link

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

@NobodysNightmare
Copy link
Contributor

Off-by-one error is gone. I now tried understanding the "after inserting a token, caret position is placed behind the token" requirement and played around a bit. In the screencast you see me:

  1. Copying a token and subsequently typing
  2. Copying the middle of a token and subsequently typing
  3. Copying a token plus some pieces left and right and subsequently typing

Of these tests, 1 has non-ideal UX, but feels acceptable, though it might be exactly what you wanted to fix. 2 is just plain weird and I have no clue what's going on. 3 works as expected.

Screencast.from.2025-03-27.13-12-48.webm

- backspace works again on tokens in firefox
- copying only parts a token is possible in firefox
@Kharonus
Copy link
Member Author

@NobodysNightmare

I think, I found the reason for backspace not working in firefox and fixed it. Also the partial copy of tokens should work now as expected (at least, as I would expect it :P)

Copy link
Contributor

@NobodysNightmare NobodysNightmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behaviourally LGTM.

Something I realize is that it would probably be great to have nitty-gritty browser-tests for this. E.g. pressing five times backspace or delete.

I understand if you don't want to add them now, but later we'd be happy to have them.

…ould-not-be-part-of-search-when-replacing-tokens
@Kharonus Kharonus merged commit f8a0180 into dev Mar 31, 2025
14 checks passed
@Kharonus Kharonus deleted the implementation/62486-parent/project-prefix-should-not-be-part-of-search-when-replacing-tokens branch March 31, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants