summaryrefslogtreecommitdiff
path: root/packages/frontend/src
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-06-05 11:55:18 +0000
committerHazelnoot <acomputerdog@gmail.com>2025-06-05 11:55:18 +0000
commitc6874c4983ccb9d8bf2d7ad1f274ef260858f88d (patch)
tree6a1ecd3a58adf0a9a1b47b0d41ebf1bc14359988 /packages/frontend/src
parentmerge: Report admin UX improvements (!1060) (diff)
parentallow note toolbar to scroll (diff)
downloadsharkey-c6874c4983ccb9d8bf2d7ad1f274ef260858f88d.tar.gz
sharkey-c6874c4983ccb9d8bf2d7ad1f274ef260858f88d.tar.bz2
sharkey-c6874c4983ccb9d8bf2d7ad1f274ef260858f88d.zip
merge: Allow note footer bar to shrink responsively and scroll on overflow (resolves #1057) (!1094)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1094 Closes #1057 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <github@yuugi.dev>
Diffstat (limited to 'packages/frontend/src')
-rw-r--r--packages/frontend/src/components/MkNote.vue28
-rw-r--r--packages/frontend/src/components/MkNoteDetailed.vue30
-rw-r--r--packages/frontend/src/components/MkNoteSub.vue24
-rw-r--r--packages/frontend/src/components/SkNote.vue42
-rw-r--r--packages/frontend/src/components/SkNoteDetailed.vue34
-rw-r--r--packages/frontend/src/components/SkNoteSub.vue14
-rw-r--r--packages/frontend/src/components/SkOldNoteWindow.vue31
-rw-r--r--packages/frontend/src/style.scss8
8 files changed, 42 insertions, 169 deletions
diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue
index 34c33270bb..16aed7898e 100644
--- a/packages/frontend/src/components/MkNote.vue
+++ b/packages/frontend/src/components/MkNote.vue
@@ -113,7 +113,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkA :to="`/notes/${appearNote.id}/reactions`" :class="[$style.reactionOmitted]">{{ i18n.ts.more }}</MkA>
</template>
</MkReactionsViewer>
- <footer :class="$style.footer">
+ <footer :class="$style.footer" class="_gaps _h_gaps" tabindex="0" role="group" :aria-label="i18n.ts.noteFooterLabel">
<button :class="$style.footerButton" class="_button" @click.stop @click="reply()">
<i class="ti ti-arrow-back-up"></i>
<p v-if="appearNote.repliesCount > 0" :class="$style.footerButtonCount">{{ number(appearNote.repliesCount) }}</p>
@@ -913,11 +913,11 @@ function emitUpdReaction(emoji: string, delta: number) {
.footer {
display: flex;
align-items: center;
- justify-content: space-between;
+ justify-content: flex-start;
position: relative;
z-index: 1;
margin-top: 0.4em;
- max-width: 400px;
+ overflow-x: auto;
}
&:hover > .article > .main > .footer > .footerButton {
@@ -1203,10 +1203,6 @@ function emitUpdReaction(emoji: string, delta: number) {
padding: 8px;
opacity: 0.7;
- &:not(:last-child) {
- margin-right: 1.5em;
- }
-
&:hover {
color: var(--MI_THEME-fgHighlighted);
}
@@ -1290,25 +1286,7 @@ function emitUpdReaction(emoji: string, delta: number) {
}
}
-@container (max-width: 400px) {
- .root:not(.showActionsOnlyHover) {
- .footerButton {
- &:not(:last-child) {
- margin-right: 0.2em;
- }
- }
- }
-}
-
@container (max-width: 350px) {
- .root:not(.showActionsOnlyHover) {
- .footerButton {
- &:not(:last-child) {
- margin-right: 0.1em;
- }
- }
- }
-
.colorBar {
top: 6px;
left: 6px;
diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue
index b2f237a82e..be0676dc5f 100644
--- a/packages/frontend/src/components/MkNoteDetailed.vue
+++ b/packages/frontend/src/components/MkNoteDetailed.vue
@@ -118,7 +118,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<MkA v-if="appearNote.channel && !inChannel" :class="$style.channel" :to="`/channels/${appearNote.channel.id}`"><i class="ti ti-device-tv"></i> {{ appearNote.channel.name }}</MkA>
</div>
- <footer :class="$style.footer">
+ <footer :class="$style.footer" class="_gaps _h_gaps" tabindex="0" role="group" :aria-label="i18n.ts.noteFooterLabel">
<div :class="$style.noteFooterInfo">
<div v-if="appearNote.updatedAt">
{{ i18n.ts.edited }}: <MkTime :time="appearNote.updatedAt" mode="detail"/>
@@ -886,12 +886,10 @@ function animatedMFM() {
}
.footer {
- position: relative;
- z-index: 1;
- margin-top: 0.4em;
- width: max-content;
- min-width: min-content;
- max-width: fit-content;
+ position: relative;
+ z-index: 1;
+ margin-top: 0.4em;
+ overflow-x: auto;
}
.replyTo {
@@ -1083,10 +1081,6 @@ function animatedMFM() {
padding: 8px;
opacity: 0.7;
- &:not(:last-child) {
- margin-right: 1.5em;
- }
-
&:hover {
color: var(--MI_THEME-fgHighlighted);
}
@@ -1169,14 +1163,6 @@ function animatedMFM() {
}
}
-@container (max-width: 350px) {
- .noteFooterButton {
- &:not(:last-child) {
- margin-right: 0.1em;
- }
- }
-}
-
@container (max-width: 300px) {
.root {
font-size: 0.825em;
@@ -1186,12 +1172,6 @@ function animatedMFM() {
width: 50px;
height: 50px;
}
-
- .noteFooterButton {
- &:not(:last-child) {
- margin-right: 0.1em;
- }
- }
}
.muted {
diff --git a/packages/frontend/src/components/MkNoteSub.vue b/packages/frontend/src/components/MkNoteSub.vue
index e6c0e83a8e..6b70fddecf 100644
--- a/packages/frontend/src/components/MkNoteSub.vue
+++ b/packages/frontend/src/components/MkNoteSub.vue
@@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSubNoteContent :class="$style.text" :note="note" :translating="translating" :translation="translation" :expandAllCws="props.expandAllCws"/>
</div>
</div>
- <footer :class="$style.footer">
+ <footer :class="$style.footer" class="_gaps _h_gaps" tabindex="0" role="group" :aria-label="i18n.ts.noteFooterLabel">
<MkReactionsViewer ref="reactionsViewer" :note="note"/>
<button class="_button" :class="$style.noteFooterButton" @click="reply()">
<i class="ph-arrow-u-up-left ph-bold ph-lg"></i>
@@ -419,12 +419,10 @@ if (props.detail) {
}
.footer {
- position: relative;
- z-index: 1;
- margin-top: 0.4em;
- width: max-content;
- min-width: min-content;
- max-width: fit-content;
+ position: relative;
+ z-index: 1;
+ margin-top: 0.4em;
+ overflow-x: auto;
}
.main {
@@ -469,23 +467,11 @@ if (props.detail) {
padding-top: 10px;
opacity: 0.7;
- &:not(:last-child) {
- margin-right: 1.5em;
- }
-
&:hover {
color: var(--MI_THEME-fgHighlighted);
}
}
-@container (max-width: 400px) {
- .noteFooterButton {
- &:not(:last-child) {
- margin-right: 0.7em;
- }
- }
-}
-
.noteFooterButtonCount {
display: inline;
margin: 0 0 0 8px;
diff --git a/packages/frontend/src/components/SkNote.vue b/packages/frontend/src/components/SkNote.vue
index c4580e9156..42b2e2a957 100644
--- a/packages/frontend/src/components/SkNote.vue
+++ b/packages/frontend/src/components/SkNote.vue
@@ -114,7 +114,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkA :to="`/notes/${appearNote.id}/reactions`" :class="[$style.reactionOmitted]">{{ i18n.ts.more }}</MkA>
</template>
</MkReactionsViewer>
- <footer :class="$style.footer">
+ <footer :class="$style.footer" class="_gaps _h_gaps" tabindex="0" role="group" :aria-label="i18n.ts.noteFooterLabel">
<button :class="$style.footerButton" class="_button" @click.stop @click="reply()">
<i class="ti ti-arrow-back-up"></i>
<p v-if="appearNote.repliesCount > 0" :class="$style.footerButtonCount">{{ number(appearNote.repliesCount) }}</p>
@@ -921,11 +921,11 @@ function emitUpdReaction(emoji: string, delta: number) {
.footer {
display: flex;
align-items: center;
- justify-content: space-between;
+ justify-content: flex-start;
position: relative;
z-index: 1;
margin-top: 0.4em;
- max-width: 400px;
+ overflow-x: auto;
}
&:hover > .article > .main > .footer > .footerButton {
@@ -947,10 +947,6 @@ function emitUpdReaction(emoji: string, delta: number) {
.footerButton {
font-size: 90%;
-
- &:not(:last-child) {
- margin-right: 0;
- }
}
}
@@ -1238,10 +1234,6 @@ function emitUpdReaction(emoji: string, delta: number) {
padding: 8px;
opacity: 0.7;
- &:not(:last-child) {
- margin-right: 1.5em;
- }
-
&:hover {
color: var(--MI_THEME-fgHighlighted);
}
@@ -1358,25 +1350,7 @@ function emitUpdReaction(emoji: string, delta: number) {
}
}
-@container (max-width: 400px) {
- .root:not(.showActionsOnlyHover) {
- .footerButton {
- &:not(:last-child) {
- margin-right: 0.2em;
- }
- }
- }
-}
-
@container (max-width: 350px) {
- .root:not(.showActionsOnlyHover) {
- .footerButton {
- &:not(:last-child) {
- margin-right: 0.1em;
- }
- }
- }
-
.colorBar {
top: 6px;
left: 6px;
@@ -1385,16 +1359,6 @@ function emitUpdReaction(emoji: string, delta: number) {
}
}
-@container (max-width: 300px) {
- .root:not(.showActionsOnlyHover) {
- .footerButton {
- &:not(:last-child) {
- margin-right: 0.1em;
- }
- }
- }
-}
-
@container (max-width: 250px) {
.quoteNote {
padding: 12px;
diff --git a/packages/frontend/src/components/SkNoteDetailed.vue b/packages/frontend/src/components/SkNoteDetailed.vue
index 8b495fb873..d57a90628e 100644
--- a/packages/frontend/src/components/SkNoteDetailed.vue
+++ b/packages/frontend/src/components/SkNoteDetailed.vue
@@ -132,7 +132,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkA>
</div>
<MkReactionsViewer v-if="appearNote.reactionAcceptance !== 'likeOnly'" ref="reactionsViewer" style="margin-top: 6px;" :note="appearNote"/>
- <footer :class="$style.footer">
+ <footer :class="$style.footer" class="_gaps _h_gaps" tabindex="0" role="group" :aria-label="i18n.ts.noteFooterLabel">
<button class="_button" :class="$style.noteFooterButton" @click="reply()">
<i class="ti ti-arrow-back-up"></i>
<p v-if="appearNote.repliesCount > 0" :class="$style.noteFooterButtonCount">{{ number(appearNote.repliesCount) }}</p>
@@ -918,13 +918,13 @@ onUnmounted(() => {
}
.footer {
- display: flex;
- align-items: center;
- justify-content: space-between;
- position: relative;
- z-index: 1;
- margin-top: 0.4em;
- max-width: 400px;
+ display: flex;
+ align-items: center;
+ justify-content: flex-start;
+ position: relative;
+ z-index: 1;
+ margin-top: 0.4em;
+ overflow-x: auto;
}
.replyTo {
@@ -1141,10 +1141,6 @@ onUnmounted(() => {
padding: 8px;
opacity: 0.7;
- &:not(:last-child) {
- margin-right: 1.5em;
- }
-
&:hover {
color: var(--MI_THEME-fgHighlighted);
}
@@ -1234,14 +1230,6 @@ onUnmounted(() => {
}
}
-@container (max-width: 350px) {
- .noteFooterButton {
- &:not(:last-child) {
- margin-right: 0.1em;
- }
- }
-}
-
@container (max-width: 300px) {
.root {
font-size: 0.825em;
@@ -1251,12 +1239,6 @@ onUnmounted(() => {
width: 50px;
height: 50px;
}
-
- .noteFooterButton {
- &:not(:last-child) {
- margin-right: 0.1em;
- }
- }
}
.avatar {
diff --git a/packages/frontend/src/components/SkNoteSub.vue b/packages/frontend/src/components/SkNoteSub.vue
index 9fa0c11d48..a520c9744e 100644
--- a/packages/frontend/src/components/SkNoteSub.vue
+++ b/packages/frontend/src/components/SkNoteSub.vue
@@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
<MkReactionsViewer ref="reactionsViewer" :note="note"/>
- <footer :class="$style.footer">
+ <footer :class="$style.footer" class="_gaps _h_gaps" tabindex="0" role="group" :aria-label="i18n.ts.noteFooterLabel">
<button class="_button" :class="$style.noteFooterButton" @click="reply()">
<i class="ph-arrow-u-up-left ph-bold ph-lg"></i>
<p v-if="note.repliesCount > 0" :class="$style.noteFooterButtonCount">{{ note.repliesCount }}</p>
@@ -449,11 +449,11 @@ if (props.detail) {
.footer {
display: flex;
align-items: center;
- justify-content: space-between;
+ justify-content: flex-start;
position: relative;
z-index: 1;
margin-top: 0.4em;
- max-width: 400px;
+ overflow-x: auto;
}
.main {
@@ -559,14 +559,6 @@ if (props.detail) {
}
}
-@container (max-width: 400px) {
- .noteFooterButton {
- &:not(:last-child) {
- margin-right: 0.7em;
- }
- }
-}
-
.noteFooterButtonCount {
display: inline;
margin: 0 0 0 8px;
diff --git a/packages/frontend/src/components/SkOldNoteWindow.vue b/packages/frontend/src/components/SkOldNoteWindow.vue
index b6dbec81c5..778a776167 100644
--- a/packages/frontend/src/components/SkOldNoteWindow.vue
+++ b/packages/frontend/src/components/SkOldNoteWindow.vue
@@ -52,7 +52,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<MkA v-if="appearNote.channel && !inChannel" :class="$style.channel" :to="`/channels/${appearNote.channel.id}`"><i class="ph-television ph-bold ph-lg"></i> {{ appearNote.channel.name }}</MkA>
</div>
- <footer :class="$style.footer">
+ <footer :class="$style.footer" class="_gaps _h_gaps" tabindex="0" role="group" :aria-label="i18n.ts.noteFooterLabel">
<div :class="$style.noteFooterInfo">
<MkTime :time="appearNote.createdAt" mode="detail"/>
</div>
@@ -163,11 +163,12 @@ const showTicker = (prefer.s.instanceTicker === 'always') || (prefer.s.instanceT
}
.footer {
- position: relative;
- z-index: 1;
- margin-top: 0.4em;
- width: max-content;
- min-width: max-content;
+ position: relative;
+ z-index: 1;
+ margin-top: 0.4em;
+ width: max-content;
+ min-width: max-content;
+ overflow-x: auto;
}
.note {
@@ -280,23 +281,11 @@ const showTicker = (prefer.s.instanceTicker === 'always') || (prefer.s.instanceT
padding: 8px;
opacity: 0.7;
- &:not(:last-child) {
- margin-right: 1.5em;
- }
-
&:hover {
color: var(--MI_THEME-fgHighlighted);
}
}
-@container (max-width: 350px) {
- .noteFooterButton {
- &:not(:last-child) {
- margin-right: 0.1em;
- }
- }
-}
-
@container (max-width: 500px) {
.root {
font-size: 0.9em;
@@ -323,11 +312,5 @@ const showTicker = (prefer.s.instanceTicker === 'always') || (prefer.s.instanceT
width: 50px;
height: 50px;
}
-
- .noteFooterButton {
- &:not(:last-child) {
- margin-right: 0.1em;
- }
- }
}
</style>
diff --git a/packages/frontend/src/style.scss b/packages/frontend/src/style.scss
index 7b2638903b..d5abe9166f 100644
--- a/packages/frontend/src/style.scss
+++ b/packages/frontend/src/style.scss
@@ -428,6 +428,14 @@ rt {
gap: var(--MI-margin);
}
+/**
+ * Use with _gaps, _gaps_m, or _gaps_s.
+ * Place the other class *first*!
+ */
+._h_gaps {
+ flex-direction: row;
+}
+
._buttons {
display: flex;
gap: 8px;