forked from yvv/decision
v3 : inertie à cinq crans — interface (L10)
L'inertie se lit en crans, « 3 / 5 · moyenne » (très basse, basse, moyenne, haute, très haute ; fr, en, es). Le sélecteur offre les cinq crans, l'actuel marqué ; le changement se vote au cran de l'article. L'article dit le passé de son inertie (vote ou réglage de départ). « Réglages de la formule », en lecture seule, depuis l'en-tête du doc et depuis le vote d'un article (onglet « Réglages » du panneau, dans l'URL) : W et sa source, C, B, la participation habituelle (médiane ou référence, sur combien de propositions, quand), et les cinq crans : M, G, part exigée, voix pour exigées à la participation de la version regardée (ou habituelle depuis l'en-tête). Composants à part (InertiaPicker, FormulaSettings), branchés par quelques lignes dans VoteView. La formule dépliée ne fait plus déborder le panneau. e2e : C4 (cran de l'article dans la formule), C20 (réglages et cinq crans), M1 (réglages lisibles sur mobile). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// The five levels of inertia, as the screen names them (ADR 0007).
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { en } from '../../src/lib/i18n/en';
|
||||
import { es } from '../../src/lib/i18n/es';
|
||||
import { fr } from '../../src/lib/i18n/fr';
|
||||
import { INERTIA_LEVELS } from '../../src/lib/types';
|
||||
|
||||
describe('five levels of inertia', () => {
|
||||
it('go from 1 to 5, 3 in the middle', () => {
|
||||
expect(INERTIA_LEVELS).toEqual([1, 2, 3, 4, 5]);
|
||||
});
|
||||
it('each level has its own short name, in the three languages', () => {
|
||||
expect(INERTIA_LEVELS.map((k) => fr[`inertia.name.${k}`])).toEqual(['très basse', 'basse', 'moyenne', 'haute', 'très haute']);
|
||||
expect(INERTIA_LEVELS.map((k) => en[`inertia.name.${k}`])).toEqual(['very low', 'low', 'medium', 'high', 'very high']);
|
||||
expect(INERTIA_LEVELS.map((k) => es[`inertia.name.${k}`])).toEqual(['muy baja', 'baja', 'media', 'alta', 'muy alta']);
|
||||
});
|
||||
it('a change of inertia is said to be voted at the level of the article, no longer one above', () => {
|
||||
for (const cat of [fr, en, es]) expect(cat['inertia.change.note']).toContain('{level}');
|
||||
expect(fr['inertia.change.note']).toContain("à l'inertie de l'article");
|
||||
expect(fr['inertia.change.note']).not.toContain('au-dessus');
|
||||
});
|
||||
});
|
||||
@@ -8,13 +8,13 @@ function prop(id: string, unitId: string, over: Partial<Proposal> = {}): Proposa
|
||||
label: null, author: null, mine: false, revision: 1, createdAt: '', updatedAt: '', submittedAt: null, enteredAt: null,
|
||||
confirmedAt: null, seedMinimal: false, tally: { for: 0, against: 0 },
|
||||
evaluation: { cast: 0, required: 50, reached: false, missing: 50, requiredRatio: 1, wellRated: false },
|
||||
votedAtInertia: 'standard', blocked: false, signals: 0, myVote: null, myVoteStale: false, translations: {},
|
||||
votedAtInertia: 3, blocked: false, signals: 0, myVote: null, myVoteStale: false, translations: {},
|
||||
...over,
|
||||
};
|
||||
}
|
||||
|
||||
function unit(id: string, proposals: Proposal[]): Unit {
|
||||
return { id, code: id, section: null, position: 0, inertia: 'standard', inForce: null, proposals };
|
||||
return { id, code: id, section: null, position: 0, inertia: 3, inertiaChanges: [], inForce: null, proposals };
|
||||
}
|
||||
|
||||
/** The reader's list: every open proposal, unit by unit, in document order. */
|
||||
|
||||
Reference in New Issue
Block a user