forked from yvv/decision
Lot U2 : le lecteur — cibles de 44 px sur téléphone dans tout le vote déplié et « Tout déplier » ; les trois lectures passent à la ligne au lieu de cacher « Si tout passe » ; « Proposer cet ordre » éteint dit pourquoi, à côté ; l'inertie dite une fois (ses crans dans « Inertie »), la ligne d'une Proposition seed s'efface sous son vote déplié, les versions déjà listées ne sont pas redites dans « Autres versions » ; l'en-tête compte ce que montre la liste (les Propositions seed à part) ; un changement d'inertie d'un ordre ou du titre a sa pastille sur la ligne du module (fr, en, es)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
// or uses its arrows; with the keyboard, the up and down arrows move the article that has
|
||||
// the focus, and the new place is said. Then « Proposer cet ordre »: the order goes to the
|
||||
// vote (ADR 0009, `POST /units/{id}/order`) and its vote unfolds at once, here. An order
|
||||
// already proposed is voted, never proposed twice.
|
||||
// already proposed is voted, never proposed twice. While the order is the one in force,
|
||||
// the button stays off and says why, beside it (lot U2, UX-lecteur.md).
|
||||
import { tick, untrack } from 'svelte';
|
||||
import { flip } from 'svelte/animate';
|
||||
import { api } from '$lib/api';
|
||||
@@ -141,10 +142,7 @@
|
||||
}
|
||||
|
||||
async function submit() {
|
||||
if (unchanged) {
|
||||
error = t('order.edit.unchanged');
|
||||
return;
|
||||
}
|
||||
if (unchanged) return;
|
||||
if (existing) {
|
||||
ondone(existing.id);
|
||||
return;
|
||||
@@ -192,8 +190,15 @@
|
||||
{#if existing && !unchanged}<p class="note" role="status">{t('order.edit.exists')}</p>{/if}
|
||||
{#if error}<p class="warn" role="alert">{error}</p>{/if}
|
||||
<div class="actions">
|
||||
{#if unchanged}<p class="why" id="order-why-{unit.id}">{t('order.edit.unchanged')}</p>{/if}
|
||||
<button class="btn quiet small" type="button" disabled={busy} onclick={oncancel}>{t('common.cancel')}</button>
|
||||
<button class="btn primary small" type="button" disabled={busy || unchanged} onclick={submit}>{t(existing ? 'order.edit.vote' : 'order.edit.submit')}</button>
|
||||
<button
|
||||
class="btn primary small"
|
||||
type="button"
|
||||
disabled={busy || unchanged}
|
||||
aria-describedby={unchanged ? `order-why-${unit.id}` : undefined}
|
||||
onclick={submit}>{t(existing ? 'order.edit.vote' : 'order.edit.submit')}</button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -338,15 +343,31 @@
|
||||
.actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
/* Why the button is off, on its left: read before one reaches for it. */
|
||||
.why {
|
||||
flex: 1 1 14rem;
|
||||
margin: 0;
|
||||
font-size: 0.84rem;
|
||||
font-weight: 650;
|
||||
color: var(--ink-soft);
|
||||
}
|
||||
/* On a phone: every target is big enough for a finger. */
|
||||
@media (max-width: 899px) {
|
||||
.arrow {
|
||||
width: 2.75rem;
|
||||
height: 2.75rem;
|
||||
}
|
||||
.actions .btn {
|
||||
min-height: 2.75rem;
|
||||
}
|
||||
/* Its own line, above the two buttons kept together. */
|
||||
.why {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
}
|
||||
@keyframes unfold {
|
||||
from {
|
||||
|
||||
Reference in New Issue
Block a user