From 37058d649dbbaabca6a763162b245aeff452bc37 Mon Sep 17 00:00:00 2001 From: Claire Date: Sun, 10 Nov 2024 22:43:27 +0100 Subject: [PATCH 1/3] Fix status clickable area (#2895) --- app/javascript/flavours/glitch/components/status.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/components/status.jsx b/app/javascript/flavours/glitch/components/status.jsx index 493ef4f68a8983..7e2da0d4c78c66 100644 --- a/app/javascript/flavours/glitch/components/status.jsx +++ b/app/javascript/flavours/glitch/components/status.jsx @@ -806,7 +806,8 @@ class Status extends ImmutablePureComponent { {(connectReply || connectUp || connectToRoot) &&
} {(!muted || !isCollapsed) && ( -
+ /* eslint-disable-next-line jsx-a11y/no-static-element-interactions */ +
Date: Mon, 11 Nov 2024 16:11:24 +0100 Subject: [PATCH 2/3] Fix clicking on avatar/display opening status instead of profile (#2897) Fix regression from #2895 --- .../flavours/glitch/components/status.jsx | 39 ++++++++++--------- .../glitch/components/status_header.jsx | 11 ++---- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/app/javascript/flavours/glitch/components/status.jsx b/app/javascript/flavours/glitch/components/status.jsx index 7e2da0d4c78c66..a8da05171ec0d3 100644 --- a/app/javascript/flavours/glitch/components/status.jsx +++ b/app/javascript/flavours/glitch/components/status.jsx @@ -372,26 +372,29 @@ class Status extends ImmutablePureComponent { const { isCollapsed } = this.state; if (!history) return; - if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) { - if (isCollapsed) this.setCollapsed(false); - else if (e.shiftKey) { - this.setCollapsed(true); - document.getSelection().removeAllRanges(); - } else if (this.props.onClick) { - this.props.onClick(); - return; - } else { - if (destination === undefined) { - destination = `/@${ - status.getIn(['reblog', 'account', 'acct'], status.getIn(['account', 'acct'])) - }/${ - status.getIn(['reblog', 'id'], status.get('id')) - }`; - } - history.push(destination); + if (e.button !== 0 || e.ctrlKey || e.altKey || e.metaKey) { + return; + } + + if (isCollapsed) this.setCollapsed(false); + else if (e.shiftKey) { + this.setCollapsed(true); + document.getSelection().removeAllRanges(); + } else if (this.props.onClick) { + this.props.onClick(); + return; + } else { + if (destination === undefined) { + destination = `/@${ + status.getIn(['reblog', 'account', 'acct'], status.getIn(['account', 'acct'])) + }/${ + status.getIn(['reblog', 'id'], status.get('id')) + }`; } - e.preventDefault(); + history.push(destination); } + + e.preventDefault(); }; handleToggleMediaVisibility = () => { diff --git a/app/javascript/flavours/glitch/components/status_header.jsx b/app/javascript/flavours/glitch/components/status_header.jsx index 5eeed3d41dcdae..dffffe4fb8512e 100644 --- a/app/javascript/flavours/glitch/components/status_header.jsx +++ b/app/javascript/flavours/glitch/components/status_header.jsx @@ -18,15 +18,10 @@ export default class StatusHeader extends PureComponent { parseClick: PropTypes.func.isRequired, }; - // Handles clicks on account name/image - handleClick = (acct, e) => { - const { parseClick } = this.props; - parseClick(e, `/@${acct}`); - }; - handleAccountClick = (e) => { - const { status } = this.props; - this.handleClick(status.getIn(['account', 'acct']), e); + const { status, parseClick } = this.props; + parseClick(e, `/@${status.getIn(['account', 'acct'])}`); + e.stopPropagation(); }; // Rendering. From bb2faaad325edfdd7f8c277052ab5751b3979e37 Mon Sep 17 00:00:00 2001 From: Claire Date: Sat, 16 Nov 2024 21:39:12 +0100 Subject: [PATCH 3/3] Fix collapse icon opening the post (#2899) --- app/javascript/flavours/glitch/components/collapse_button.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/javascript/flavours/glitch/components/collapse_button.jsx b/app/javascript/flavours/glitch/components/collapse_button.jsx index 36cda45361de5f..30008f1ff95155 100644 --- a/app/javascript/flavours/glitch/components/collapse_button.jsx +++ b/app/javascript/flavours/glitch/components/collapse_button.jsx @@ -19,6 +19,7 @@ export const CollapseButton = ({ collapsed, setCollapsed }) => { if (e.button === 0) { setCollapsed(!collapsed); e.preventDefault(); + e.stopPropagation(); } }, [collapsed, setCollapsed]);