Compare commits

...

3 Commits

Author SHA1 Message Date
Dhruwang 5d68d1f524 refactor: adjust padding and text handling in OpenID button
Updated the OpenID button to include horizontal padding and simplified the text rendering logic. This change ensures better alignment and visual consistency, while maintaining the truncation behavior for long text. The 'last used' indicator remains unaffected.
2026-04-15 14:55:05 +05:30
xhamzax ed0c36a87f refactor: use flex layout instead of absolute positioning for last-used badge
Addresses coderabbitai feedback: replace the absolute-positioned badge
with a flex sibling layout (gap-2) so the label can truncate naturally
and the badge gets a stable gap regardless of text length. Removes the
magic pr-16 padding and absolute right-3 that broke on long translations.
2026-04-14 05:36:42 +01:00
xhamzax c0ed93be7a fix: prevent OIDC button text overlap with 'last used' indicator
When OIDC_DISPLAY_NAME is set to a long value (e.g. 'OIDC lemonldap'),
the centered button text can extend into the area where the absolutely-
positioned 'last used' indicator sits (right-3, opacity-50). In Firefox,
this causes visible text bleed-through where the two labels overlap.

Wrap the main text in a truncate span so it ellipsis-truncates before
reaching the indicator area, and add overflow-hidden on the button to
clip any remaining overflow. When lastUsed is shown, apply pr-16 to
leave room for the indicator. Add shrink-0 on the indicator span so
it doesn't collapse.

Fixes #7539
2026-04-14 05:36:42 +01:00
@@ -46,9 +46,9 @@ export const OpenIdButton = ({
type="button"
onClick={handleLogin}
variant="secondary"
className="relative w-full justify-center">
{text ? text : t("auth.continue_with_openid")}
{lastUsed && <span className="absolute right-3 text-xs opacity-50">{t("auth.last_used")}</span>}
className="w-full items-center justify-center gap-2 px-2">
<span className="truncate">{text || t("auth.continue_with_openid")}</span>
{lastUsed && <span className="shrink-0 text-xs opacity-50">{t("auth.last_used")}</span>}
</Button>
);
};