Skip to content

feat: show word length#406

Closed
DeepSpace2 wants to merge 3 commits intoscribble-rs:masterfrom
DeepSpace2:amount-of-letters-hint
Closed

feat: show word length#406
DeepSpace2 wants to merge 3 commits intoscribble-rs:masterfrom
DeepSpace2:amount-of-letters-hint

Conversation

@DeepSpace2
Copy link
Contributor

@DeepSpace2 DeepSpace2 commented Feb 27, 2026

Closes #356

Showing the length of the word(s) after the word hint. It correctly handles RTL wordpacks and words with whitespaces (see images).

Note that it required to show the hint on a separate line on mobile to ensure there is enough space.

English wordpack with a whitespace, desktop
english-desktop-space


English wordpack with a whitespace, mobile english-mobile-space
English wordpack, mobile english-mobile
Longest word in the english wordpack, mobile 😄 english-mobile-longest-word
Hebrew (RTL) wordpack with a whitespace, desktop

hebrew-desktop-space


Hebrew (RTL) wordpack with a whitespace, mobile
hebrew-mobile-space


// Since chromes implementation of the popup is dumb, we can't position
// it correctly without javascript.
if (!navigator.userAgent.toLowerCase().includes("firefox")) {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason you removed this guard? As far as I could tell, only chrome was too dumb to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I believe it is not needed anymore as I removed position: absolute from #menu. The popup appears at the correct location both on mobile and on desktop.

desktop:

image

mobile

image

Copy link
Member

Choose a reason for hiding this comment

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

It wasn't needed to begin with. I just didn't want to meddle with default browser behaviour where I could, I think 🤔 Like the comment above mentions, firefox doesn't require the code at all to work correctly. I assume this would still be the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I'm following. I removed the chrome-specific (or, rather, any non-firefox browser) guard because it wasn't required anymore as with the updated code the menu appears correctly on both chrome and firefox.

Copy link
Member

Choose a reason for hiding this comment

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

The point was, that chrome NEEDED the code and firefox didn't. Maybe I wasn't clear.

Chrome with the toggle listener removed:

image

Firefox with the toggle listener removed:

image

However, it seems that there's now a way to achieve this WITHOUT Javascript.

I will try :)

Copy link
Member

@Bios-Marcel Bios-Marcel Mar 1, 2026

Choose a reason for hiding this comment

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

Here, if you are interested: a40b07a

I will merge in a separate PR to save you applying that stuff

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, nice 👍

@Bios-Marcel
Copy link
Member

I'd say the menu button container should also be the same height as the other two elements, looks a little weird otherwise.

It's also a bit weird that the container for the word disappears after the game and isn't there before the game, but only in mobile mode 🤔

image

@DeepSpace2
Copy link
Contributor Author

I'd say the menu button container should also be the same height as the other two elements, looks a little weird otherwise.

It's also a bit weird that the container for the word disappears after the game and isn't there before the game, but only in mobile mode 🤔

Fixed both

image

@Bios-Marcel
Copy link
Member

The history was messed up ... i merged manually using diffs.

@Bios-Marcel Bios-Marcel closed this Mar 1, 2026
@DeepSpace2 DeepSpace2 deleted the amount-of-letters-hint branch March 1, 2026 20:57
@Bios-Marcel
Copy link
Member

I deployed the changes :)

Gonna wait for a release again if there's any bug report.

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.

Display amount of letters (with spaces?) in tooltip on wordhint

2 participants