authorgravatar for saphid@gmail.comAlex Southwell <saphid@gmail.com> 2026-09-06 17:11:41+10:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-06 00:11:41-07:00
log127efae4401cf2cc0fcd7ec7c5b2e2c037fe4151
treee9e99608c0307be60438df5d97fa3872cee8215e
parent00d6109cbb1a13712d7347701969870aee83252d
signature Signed by PGP key B5690EEEBB952194

fix(web): expose error disclosure state (#10125)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

1 files changed, 5 insertions(+), 1 deletions(-)

apps/web/src/components/settings/ExpandableText.tsx+5-1
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1import { useState } from "react";1import { useId, useState } from "react";
22
3import { cn } from "../../lib/utils";3import { cn } from "../../lib/utils";
44
...@@ -17,12 +17,14 @@ export function ExpandableText({...@@ -17,12 +17,14 @@ export function ExpandableText({
17 collapsedClassName?: string;17 collapsedClassName?: string;
18 expandLabel?: string;18 expandLabel?: string;
19}) {19}) {
20 const textId = useId();
20 const [expanded, setExpanded] = useState(false);21 const [expanded, setExpanded] = useState(false);
21 const canExpand = text.length > 180 || text.includes("\n");22 const canExpand = text.length > 180 || text.includes("\n");
2223
23 return (24 return (
24 <div className={cn("min-w-0", className)}>25 <div className={cn("min-w-0", className)}>
25 <div26 <div
27 id={textId}
26 className={cn(28 className={cn(
27 "whitespace-pre-wrap break-words",29 "whitespace-pre-wrap break-words",
28 !expanded && canExpand ? collapsedClassName : null,30 !expanded && canExpand ? collapsedClassName : null,
...@@ -33,6 +35,8 @@ export function ExpandableText({...@@ -33,6 +35,8 @@ export function ExpandableText({
33 {canExpand ? (35 {canExpand ? (
34 <button36 <button
35 type="button"37 type="button"
38 aria-expanded={expanded}
39 aria-controls={textId}
36 className="cursor-pointer mt-1 text-[11px] font-medium text-foreground/70 underline-offset-2 hover:text-foreground hover:underline"40 className="cursor-pointer mt-1 text-[11px] font-medium text-foreground/70 underline-offset-2 hover:text-foreground hover:underline"
37 onClick={() => setExpanded((value) => !value)}41 onClick={() => setExpanded((value) => !value)}
38 >42 >