diff --git a/src/components/keyboard-shortcuts-help.jsx b/src/components/keyboard-shortcuts-help.jsx
index df4e437b..fbee4e9f 100644
--- a/src/components/keyboard-shortcuts-help.jsx
+++ b/src/components/keyboard-shortcuts-help.jsx
@@ -94,7 +94,13 @@ export default memo(function KeyboardShortcutsHelp() {
),
},
{
- action: 'Toggle expanded/collapsed thread',
+ action: (
+ <>
+ Expand content warning or
+
+ toggle expanded/collapsed thread
+ >
+ ),
keys: x,
},
{
diff --git a/src/components/status.jsx b/src/components/status.jsx
index b1e609f9..7b2f84ba 100644
--- a/src/components/status.jsx
+++ b/src/components/status.jsx
@@ -1021,6 +1021,20 @@ function Status({
enabled: hotkeysEnabled && canBoost,
},
);
+ const xRef = useHotkeys('x', (e) => {
+ const activeStatus = document.activeElement.closest(
+ '.status-link, .status-focus',
+ );
+ if (activeStatus) {
+ const spoilerButton = activeStatus.querySelector(
+ 'button.spoiler:not(.spoiling)',
+ );
+ if (spoilerButton) {
+ e.stopPropagation();
+ spoilerButton.click();
+ }
+ }
+ });
const displayedMediaAttachments = mediaAttachments.slice(
0,
@@ -1169,6 +1183,7 @@ function Status({
fRef.current = nodeRef;
dRef.current = nodeRef;
bRef.current = nodeRef;
+ xRef.current = nodeRef;
}}
tabindex="-1"
class={`status ${