replace quote/reply with radiogroup and made it wrap

This commit is contained in:
Henry Jameson 2026-05-05 12:29:12 +03:00
commit 1227061655
3 changed files with 24 additions and 33 deletions

View file

@ -373,14 +373,20 @@ const PostStatusForm = {
quotable() {
return this.quotingAvailable && this.replyTo
},
quoteThreadToggled() {
return this.newStatus.hasQuote && this.newStatus.quote.thread
quoteThreadToggled: {
get() {
return this.newStatus.hasQuote && this.newStatus.quote.thread
},
set(value) {
this.newStatus.hasQuote = value
this.newStatus.quote.thread = value
this.newStatus.quote.id = value ? this.replyTo : ''
}
},
defaultQuotable() {
if (
!this.quotingAvailable ||
!this.isReply ||
!this.$store.getters.mergedConfig.quoteReply
!this.isReply
) {
return false
}
@ -868,11 +874,6 @@ const PostStatusForm = {
quote.url = ''
quote.thread = quotable
},
setQuoteThread(v) {
this.newStatus.hasQuote = v
this.newStatus.quote.thread = v
this.newStatus.quote.id = v ? this.replyTo : ''
},
clearQuoteForm() {
if (this.$refs.quoteForm) {
this.$refs.quoteForm.clear()

View file

@ -90,9 +90,10 @@
}
.reply-or-quote-selector {
flex: 1 0 auto;
flex-wrap: wrap;
margin-bottom: 0.5em;
display: grid;
gap: 1em;
display: flex;
grid-template-columns: 1fr 1fr;
}

View file

@ -88,7 +88,7 @@
</div>
<div
v-if="!disablePreview"
class="preview-heading faint"
class="preview-heading"
>
<a
class="preview-toggle faint"
@ -110,34 +110,23 @@
<div
v-if="quotable"
role="radiogroup"
class="btn-group reply-or-quote-selector"
class="reply-or-quote-selector"
>
<button
:id="`reply-or-quote-option-${randomSeed}-reply`"
class="btn button-default reply-or-quote-option"
:class="{ toggled: !quoteThreadToggled }"
tabindex="0"
<Checkbox
role="radio"
:disabled="quoteFormVisible"
:aria-labelledby="`reply-or-quote-option-${randomSeed}-reply`"
:aria-checked="!newStatus.quote.thread"
@click="setQuoteThread(false)"
:radio="true"
:model-value="!quoteThreadToggled"
@update:model-value="e => quoteThreadToggled = !e"
>
{{ $t('post_status.reply_option') }}
</button>
<button
:id="`reply-or-quote-option-${randomSeed}-quote`"
class="btn button-default reply-or-quote-option"
:class="{ toggled: quoteThreadToggled }"
tabindex="0"
role="radio"
</Checkbox>
<Checkbox
v-model="quoteThreadToggled"
:radio="true"
:disabled="quoteFormVisible"
:aria-labelledby="`reply-or-quote-option-${randomSeed}-quote`"
:aria-checked="newStatus.quote.thread"
@click="setQuoteThread(true)"
>
{{ $t('post_status.quote_option') }}
</button>
</Checkbox>
</div>
</div>
<div