Truncate long server names on login/register screen#7498
Conversation
Signed-off-by: Aaron Raimist <aaron@raim.ist>
| let serverName: React.ReactNode = serverConfig.isNameResolvable ? serverConfig.hsName : serverConfig.hsUrl; | ||
| if (serverConfig.hsNameIsDifferent) { | ||
| serverName = <TextWithTooltip class="mx_Login_underlinedServerName" tooltip={serverConfig.hsUrl}> | ||
| { serverConfig.hsName } | ||
| </TextWithTooltip>; | ||
| } | ||
| serverName = <TextWithTooltip | ||
| class={serverConfig.hsNameIsDifferent ? "mx_Login_underlinedServerName" : ""} | ||
| tooltip={serverConfig.hsUrl}> | ||
| { serverConfig.hsName } | ||
| </TextWithTooltip>; |
There was a problem hiding this comment.
this no longer really makes sense, L72 sets a string which doesn't get used.
And now there's always a tooltip, even if it is wholly redundant.
There was a problem hiding this comment.
There was a problem hiding this comment.
I believe it was a design/product thing to only show it when the name doesn't match, but I agree with your evaluation
There was a problem hiding this comment.
Ah but that only happens because of your change, previously it'd show https://localhost:8700 inline due to the ternary statement you removed
There was a problem hiding this comment.
It'd be good if this PR, labelled Truncate long server names on login/register screen did just that, rather than also tweaking the behaviour of what name is shown when
There was a problem hiding this comment.
I'm not sure what you mean. This is what it looks like on develop. No inline additional information and no tooltip with extra information.
Sounds like isNameResolvable may be set true for some reason in your case then
There was a problem hiding this comment.
The current logic to summarise is
If the HS server_name !== domain hostname: show server_name with underline & tooltip
Elif the name is resolvable (gotten via well-known) then show the server_name
Else show the URL
There was a problem hiding this comment.
Ah yes I do see that when I click edit and enter https://localhost:8700 but it doesn't work when https://localhost:8700 is configured as the default (using default_server_config).
There was a problem hiding this comment.
Yeah that's a known behaviour for default_server_config - its always trusted to be correct and treated as if it was fetched from .well-known
Signed-off-by: Aaron Raimist <aaron@raim.ist>




Fixes element-hq/element-web#18452
Before:

After:

Here's what your changelog entry will look like:
🐛 Bug Fixes
Preview: https://61dc3a5abb5c3dbba7154468--matrix-react-sdk.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.