diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 76f595c6..981516b2 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -633,7 +633,7 @@ function Compose({ {!!replyToStatus && (
- +
Replying to @ {replyToStatus.account.acct || replyToStatus.account.username} @@ -643,7 +643,7 @@ function Compose({ )} {!!editStatus && (
- +
Editing source status
)} diff --git a/src/components/shortcuts-settings.jsx b/src/components/shortcuts-settings.jsx index 77bdbf0b..15334e39 100644 --- a/src/components/shortcuts-settings.jsx +++ b/src/components/shortcuts-settings.jsx @@ -235,7 +235,11 @@ function ShortcutsSettings() { type="radio" name="shortcuts-view-mode" value={value} - checked={snapStates.settings.shortcutsViewMode === value} + checked={ + snapStates.settings.shortcutsViewMode === value || + (value === 'float-button' && + !snapStates.settings.shortcutsViewMode) + } onChange={(e) => { states.settings.shortcutsViewMode = e.target.value; }} diff --git a/src/components/status.jsx b/src/components/status.jsx index 8494538b..92d83af3 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -70,6 +70,7 @@ function Status({ readOnly, contentTextWeight, enableTranslate, + previewMode, }) { if (skeleton) { return ( @@ -210,10 +211,14 @@ function Status({ onResize: () => { if (spoilerContentRef.current) { const { scrollHeight, clientHeight } = spoilerContentRef.current; - spoilerContentRef.current.classList.toggle( - 'truncated', - scrollHeight > clientHeight, - ); + if (scrollHeight < window.innerHeight * 0.4) { + spoilerContentRef.current.classList.remove('truncated'); + } else { + spoilerContentRef.current.classList.toggle( + 'truncated', + scrollHeight > clientHeight, + ); + } } }, }); @@ -223,10 +228,14 @@ function Status({ onResize: () => { if (contentRef.current) { const { scrollHeight, clientHeight } = contentRef.current; - contentRef.current.classList.toggle( - 'truncated', - scrollHeight > clientHeight, - ); + if (scrollHeight < window.innerHeight * 0.4) { + contentRef.current.classList.remove('truncated'); + } else { + contentRef.current.classList.toggle( + 'truncated', + scrollHeight > clientHeight, + ); + } } }, }); @@ -578,6 +587,7 @@ function Status({ onContextMenu={(e) => { if (size === 'l') return; if (e.metaKey) return; + if (previewMode) return; // console.log('context menu', e); const link = e.target.closest('a'); if (link && /^https?:\/\//.test(link.getAttribute('href'))) return; @@ -662,7 +672,7 @@ function Status({ )} */} {/* */}{' '} {size !== 'l' && - (url ? ( + (url && !previewMode ? ( { let { target } = e; target = target.closest('a'); @@ -35,20 +35,22 @@ function handleContentLinks(opts) { instance, }; } - } else if (target.classList.contains('hashtag')) { - e.preventDefault(); - e.stopPropagation(); - const tag = target.innerText.replace(/^#/, '').trim(); - const hashURL = instance ? `#/${instance}/t/${tag}` : `#/t/${tag}`; - console.log({ hashURL }); - location.hash = hashURL; - } else if (states.unfurledLinks[target.href]?.url) { - e.preventDefault(); - e.stopPropagation(); - states.prevLocation = { - pathname: location.hash.replace(/^#/, ''), - }; - location.hash = `#${states.unfurledLinks[target.href].url}`; + } else if (!previewMode) { + if (target.classList.contains('hashtag')) { + e.preventDefault(); + e.stopPropagation(); + const tag = target.innerText.replace(/^#/, '').trim(); + const hashURL = instance ? `#/${instance}/t/${tag}` : `#/t/${tag}`; + console.log({ hashURL }); + location.hash = hashURL; + } else if (states.unfurledLinks[target.href]?.url) { + e.preventDefault(); + e.stopPropagation(); + states.prevLocation = { + pathname: location.hash.replace(/^#/, ''), + }; + location.hash = `#${states.unfurledLinks[target.href].url}`; + } } }; }