D1, correzioni della revisione: conteggi della Libreria più rapidi, frecce che seguono le tessere, Dashboard nei testi
- /api/library/days in «Tutte le foto» faceva due volte il passaggio su tutta la tabella media a ogni aggiornamento del mosaico: il totale dei file è ora la somma dei giorni (CountLibraryFilesAsync tolto). - I totali e i conteggi per giorno di «Foto» e «Video» su tutta la libreria non pagano più un EXISTS per post (1,3-1,6 s): elenco degli elementi con file di quel tipo su un indice di copertura, 86-141 ms su 200.000 elementi; nuove misure con limite 600 ms in LibraryScaleTests. - La quota di chi aspetta non è un minimo per tipo: corretti commento e decisioni, prova con un arretrato più vecchio di un altro tipo. - Visualizzatore in «Tutte le foto»: le frecce saltano i file che non sono tessere (foto sotto «Video» e simili) e l'intestazione non dà il numero di un altro file; la voce già scelta dell'interruttore non ridisegna il mosaico. Prova d'interfaccia nuova (solo CI). - «Ricetta sospesa» dice di riattivarla dalla Dashboard, non da Attività; commenti aggiornati. - Nomi accessibili distinti nella scheda account, variabile in inglese in download-order.js, icona activity tolta perché nessuna pagina la usa. - Schermate 06, 11 e 14 rifatte con /dashboard e nuova 01-libreria-tutte-le-foto, confrontate con i mockup in docs/schermate/differenze.md (con quattro difetti visivi ancora da sistemare). - LEGGIMI del web (mode, cursore, files, moduli riusabili) e guida della Libreria (la scelta del mosaico resta nel browser, a differenza del tema). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
30e159cbd4
commit
58ff4e48b3
44 files changed
+261
-118
No files matched your search
@@ -1,5 +1,5 @@
|
||||
// The engine and the library as seen by the pages: one event stream (/api/eventi) for the whole interface.
|
||||
// «motore» carries the snapshot (sidebar, stop strip, Attività); «libreria» says the library changed.
|
||||
// «motore» carries the snapshot (sidebar, stop strip, Dashboard); «libreria» says the library changed.
|
||||
|
||||
import { api, eventsUrl } from './api.js';
|
||||
import { caps } from './context.js';
|
||||
|
||||
@@ -384,7 +384,8 @@ function settingsTab(page, detail) {
|
||||
label: t('impAccount.ordineScelta'),
|
||||
});
|
||||
const orderChoice = segmented({
|
||||
label: t('impAccount.ordineScelta'),
|
||||
// The list is «Ordine dei tipi per questo account»; the two-way choice has the name of the section.
|
||||
label: t('impAccount.ordine'),
|
||||
value: Array.isArray(form.downloadOrder) && form.downloadOrder.length ? 'own' : 'general',
|
||||
options: [{ value: 'general', label: t('impAccount.ordineGenerale') }, { value: 'own', label: t('impAccount.ordineSuo') }],
|
||||
onchange: (v) => {
|
||||
|
||||
@@ -53,13 +53,13 @@ export function orderEditor({ read, write, changed, off = () => false, label })
|
||||
const order = read();
|
||||
fill(list, order.map((kind, i) => {
|
||||
const name = kindName(kind);
|
||||
const spento = off(kind);
|
||||
const row = h(spento ? 'li.riga-ordine.spenta' : 'li.riga-ordine', { draggable: 'true', dataset: { tipo: kind } },
|
||||
const switchedOff = off(kind);
|
||||
const row = h(switchedOff ? 'li.riga-ordine.spenta' : 'li.riga-ordine', { draggable: 'true', dataset: { tipo: kind } },
|
||||
h('span.maniglia', { title: t('impostazioni.limiti.ordineManiglia'), 'aria-hidden': 'true' }, icon('grip-vertical', 's')),
|
||||
h('span.posizione.dati', String(i + 1)),
|
||||
h('b', name),
|
||||
spento ? h('span.muto.piccolo', t('impostazioni.limiti.ordineSpento')) : null,
|
||||
kind === 'storie' && i > 0 && !spento ? h('span.muto.piccolo', icon('clock', 'xs'), ' ', t('impostazioni.limiti.ordineStorie')) : null,
|
||||
switchedOff ? h('span.muto.piccolo', t('impostazioni.limiti.ordineSpento')) : null,
|
||||
kind === 'storie' && i > 0 && !switchedOff ? h('span.muto.piccolo', icon('clock', 'xs'), ' ', t('impostazioni.limiti.ordineStorie')) : null,
|
||||
h('div.destra',
|
||||
h('button.btn.piccolo.nudo', {
|
||||
type: 'button', disabled: i === 0, dataset: { verso: 'su' }, 'aria-label': t('impostazioni.limiti.ordineSuDi', { tipo: name }), onclick: () => move(i, i - 1, 'su'),
|
||||
|
||||
@@ -13,24 +13,33 @@ import { t, dayName, duration, capitalize } from '../core/text.js';
|
||||
import { avatar, segmented } from '../core/ui.js';
|
||||
|
||||
/**
|
||||
* «Raggruppa i post» or «Tutte le foto» of a page ('libreria', or 'account' for every account), remembered in this
|
||||
* browser like the theme (spec §4.6). Storage that is missing, blocked or holds anything else means grouped.
|
||||
* «Raggruppa i post» or «Tutte le foto» of a page ('libreria', or 'account' for every account), kept only in the
|
||||
* local storage of this browser (spec §4.6): unlike the theme, Febe does not save it, so another browser starts
|
||||
* grouped. Storage that is missing, blocked or holds anything else means grouped.
|
||||
*/
|
||||
export function storedMode(page) {
|
||||
return local.get(`mosaico.${page}`, 'grouped') === 'files' ? 'files' : 'grouped';
|
||||
}
|
||||
|
||||
/** The two-voice switch of the tools row; onchange(mode) after the choice is remembered. compact: icons only sooner. */
|
||||
/**
|
||||
* The two-voice switch of the tools row; onchange(mode) after the choice is remembered, and only when the mode
|
||||
* changes: the voice already chosen does nothing (the mosaic, its place and the selection stay). compact: icons only
|
||||
* sooner.
|
||||
*/
|
||||
export function modeSwitch(page, onchange, { compact = false } = {}) {
|
||||
const labels = { grouped: t('libreria.modi.grouped'), files: t('libreria.modi.files') };
|
||||
// The mode shown, kept here: without browser storage storedMode() always says grouped.
|
||||
let current = storedMode(page);
|
||||
const group = segmented({
|
||||
label: t('libreria.modi.etichetta'),
|
||||
value: storedMode(page),
|
||||
value: current,
|
||||
options: [
|
||||
{ value: 'grouped', icon: 'layers', label: h('span.voce', labels.grouped) },
|
||||
{ value: 'files', icon: 'layout-grid', label: h('span.voce', labels.files) },
|
||||
],
|
||||
onchange: (value) => {
|
||||
if (value === current) return;
|
||||
current = value;
|
||||
local.set(`mosaico.${page}`, value);
|
||||
onchange(value);
|
||||
},
|
||||
|
||||
@@ -112,6 +112,11 @@ export function openViewer({ tile, source, origin, onDeleted }) {
|
||||
const at = mediaId == null ? -1 : entry.media.findIndex((m) => m.id === mediaId);
|
||||
if (at >= 0) fileIndex = at;
|
||||
else fileIndex = index < 0 ? entry.media.length - 1 : Math.min(index, entry.media.length - 1);
|
||||
if (files && at < 0) {
|
||||
// Entered from an edge without a file named: the first (or last) file that is a tile.
|
||||
const tiles = entry.media.map((m, i) => (source.has(m.id) ? i : -1)).filter((i) => i >= 0);
|
||||
if (tiles.length) fileIndex = index < 0 ? tiles[tiles.length - 1] : tiles[0];
|
||||
}
|
||||
draw();
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
@@ -120,7 +125,10 @@ export function openViewer({ tile, source, origin, onDeleted }) {
|
||||
|
||||
async function step(delta) {
|
||||
if (!entry) return;
|
||||
const target = fileIndex + delta;
|
||||
let target = fileIndex + delta;
|
||||
// With «Tutte le foto» the arrows follow the tiles: the files the mosaic does not show (the photos of a post under
|
||||
// «Video», the videos under «Foto», a file not in the library) are passed over, as the mosaic passes over them.
|
||||
if (files) while (target >= 0 && target < entry.media.length && !source.has(entry.media[target].id)) target += delta;
|
||||
if (target >= 0 && target < entry.media.length) {
|
||||
fileIndex = target;
|
||||
drawFile();
|
||||
@@ -149,7 +157,10 @@ export function openViewer({ tile, source, origin, onDeleted }) {
|
||||
}
|
||||
|
||||
function drawWhere() {
|
||||
const key = source && source.position ? keyAt(0) : null;
|
||||
// With «Tutte le foto» the place is that of the file on screen; a file that is not a tile (chosen in the series
|
||||
// strip) has none, and the header says only where the viewer was opened.
|
||||
const current = files && entry.media[fileIndex];
|
||||
const key = !source || !source.position ? null : !files ? keyAt(0) : current && source.has(current.id) ? current.id : null;
|
||||
if (key != null) {
|
||||
const p = source.position(key);
|
||||
where.textContent = p.index ? t(files ? 'vis.doveFile' : 'vis.dove', { origine: origin, n: number(p.index), totale: number(p.total) }) : origin;
|
||||
|
||||
Reference in new issue
Block a user