From 08dc44263d0ad9f17963d6fd0573012ab240ac08 Mon Sep 17 00:00:00 2001 From: diondiondion Date: Tue, 26 May 2026 19:42:49 +0200 Subject: [PATCH] [Glitch] Accessibility: Ensure focus order of post elements matches visual reading order Port d20d04922672ed016029c40ed64798f341ebca91 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/components/status.jsx | 15 +++++----- .../glitch/components/status/header.tsx | 9 ++++-- .../glitch/components/status_quoted.tsx | 25 +++++++++-------- .../components/pinned_statuses.tsx | 28 +++++++++++-------- .../account_timeline/styles.module.scss | 3 ++ .../glitch/styles/mastodon/components.scss | 1 - 6 files changed, 47 insertions(+), 34 deletions(-) diff --git a/app/javascript/flavours/glitch/components/status.jsx b/app/javascript/flavours/glitch/components/status.jsx index f7e24b3bfc..45344e6638 100644 --- a/app/javascript/flavours/glitch/components/status.jsx +++ b/app/javascript/flavours/glitch/components/status.jsx @@ -713,13 +713,14 @@ class Status extends ImmutablePureComponent { account={account} avatarSize={avatarSize} onHeaderClick={this.handleHeaderClick} - > - - + contentBeforeDate={ + + } + /> ); return ( diff --git a/app/javascript/flavours/glitch/components/status/header.tsx b/app/javascript/flavours/glitch/components/status/header.tsx index 8b6566cd37..8d1369ff56 100644 --- a/app/javascript/flavours/glitch/components/status/header.tsx +++ b/app/javascript/flavours/glitch/components/status/header.tsx @@ -18,7 +18,8 @@ export interface StatusHeaderProps { status: Status; account?: Account; avatarSize?: number; - children?: ReactNode; + contentBeforeDate?: ReactNode; + contentAfterDate?: ReactNode; wrapperProps?: HTMLAttributes; displayNameProps?: DisplayNameProps; onHeaderClick?: MouseEventHandler; @@ -31,10 +32,11 @@ export type StatusHeaderRenderFn = (args: StatusHeaderProps) => ReactNode; export const StatusHeader: FC = ({ status, account, - children, className, avatarSize = 48, wrapperProps, + contentBeforeDate, + contentAfterDate, onHeaderClick, }) => { const statusAccount = status.get('account') as Account | undefined; @@ -54,7 +56,8 @@ export const StatusHeader: FC = ({ avatarSize={avatarSize} /> - {children} + {contentBeforeDate} + {contentAfterDate} ); }; diff --git a/app/javascript/flavours/glitch/components/status_quoted.tsx b/app/javascript/flavours/glitch/components/status_quoted.tsx index e53c99f978..a174340457 100644 --- a/app/javascript/flavours/glitch/components/status_quoted.tsx +++ b/app/javascript/flavours/glitch/components/status_quoted.tsx @@ -226,17 +226,20 @@ export const QuotedStatus: React.FC = ({ const intl = useIntl(); const headerRenderFn: StatusHeaderRenderFn = useCallback( (props) => ( - - {onQuoteCancel && ( - - )} - + + ) + } + /> ), [intl, onQuoteCancel], ); diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/pinned_statuses.tsx b/app/javascript/flavours/glitch/features/account_timeline/components/pinned_statuses.tsx index 06192dba06..b5406d8bc0 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/pinned_statuses.tsx +++ b/app/javascript/flavours/glitch/features/account_timeline/components/pinned_statuses.tsx @@ -22,18 +22,22 @@ export const renderPinnedStatusHeader: StatusHeaderRenderFn = ({ return ; } return ( - - } - label={ - - } - /> - + } + label={ + + } + /> + } + /> ); }; diff --git a/app/javascript/flavours/glitch/features/account_timeline/styles.module.scss b/app/javascript/flavours/glitch/features/account_timeline/styles.module.scss index cd5cef3f29..9773861d22 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/styles.module.scss +++ b/app/javascript/flavours/glitch/features/account_timeline/styles.module.scss @@ -126,4 +126,7 @@ .pinnedBadge { justify-self: end; + + // Allow "click to open post" event to pass through + pointer-events: none; } diff --git a/app/javascript/flavours/glitch/styles/mastodon/components.scss b/app/javascript/flavours/glitch/styles/mastodon/components.scss index b6fde830a1..b89fc2970d 100644 --- a/app/javascript/flavours/glitch/styles/mastodon/components.scss +++ b/app/javascript/flavours/glitch/styles/mastodon/components.scss @@ -1716,7 +1716,6 @@ body > [data-popper-placement] { .status__quote-cancel { align-self: self-start; - order: 5; } .status__info {