Courrier v1.2 (tt-2026-11-064) : tri du jour du plus recent au plus ancien, repartition par nombre de mails decroissant

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGaEeWkqZYNP6Wn3mGQsrL
This commit is contained in:
gemini-opsandClaude Sonnet 5.5 committed 2026-11-17 22:38:37 +01:00
1 parent 71262d927e
commit cdb78c3e04
3 files changed
+32 -6

No files matched your search

+4 -4
View File
@@ -119,7 +119,7 @@
if (jour !== S.jour) return;
var r = rs[1];
S.miroirErreur = !!r.miroir_erreur;
S.mails = (r.mails || []).map(normaliser).sort(function (a, b) { return String(a.date).localeCompare(String(b.date)); });
S.mails = (r.mails || []).map(normaliser).sort(function (a, b) { return String(b.date).localeCompare(String(a.date)); });
S.etat = 'ok'; S.majHeure = heureTunis(new Date().toISOString());
rendre();
}).catch(function (e) { if (e.message === 'session') return; if (jour !== S.jour) return; S.etat = 'erreur'; rendre(); });
@@ -350,7 +350,7 @@
var tous = S.mails, nbT = tous.filter(function (m) { return m.traite; }).length;
var compte = {}; tous.forEach(function (m) { compte[m.cat] = (compte[m.cat] || 0) + 1; });
var puces = h('div', { class: 'puces', role: 'group', 'aria-label': 'Filtrer par catégorie' });
var defs = [{ nom: 'Tous', c: -1, n: tous.length, filtre: null }].concat(S.cats.map(function (c) { return { nom: c.nom, c: couleur(c.nom, c.id), n: compte[c.nom] || 0, filtre: c.nom }; }));
var defs = [{ nom: 'Tous', c: -1, n: tous.length, filtre: null }].concat(S.cats.map(function (c, i) { return { nom: c.nom, c: couleur(c.nom, c.id), n: compte[c.nom] || 0, filtre: c.nom, rang: i }; }).sort(function (x, y) { return y.n - x.n || x.rang - y.rang; }));
defs.forEach(function (p) {
var actif = S.filtre === p.filtre;
puces.appendChild(h('button', { type: 'button', 'aria-pressed': actif ? 'true' : 'false', class: 'puce' + (p.c === 0 ? ' vide' : '') + (p.c > 0 ? ' t' + p.c : ''), onclick: function () { S.filtre = actif ? null : p.filtre; rendre(); } },
@@ -444,8 +444,8 @@
var cc = {}, ce = {};
G.mails.forEach(function (m) { cc[m.cat] = (cc[m.cat] || 0) + 1; (m.etiquettes || []).forEach(function (t) { ce[t] = (ce[t] || 0) + 1; }); });
var pc = h('div', { class: 'puces', role: 'group', 'aria-label': 'Catégorie' });
S.cats.forEach(function (c) {
var k = couleur(c.nom, c.id), actif = G.cat === c.nom;
S.cats.map(function (c, i) { return { c: c, rang: i }; }).sort(function (x, y) { return (cc[y.c.nom] || 0) - (cc[x.c.nom] || 0) || x.rang - y.rang; }).forEach(function (o) {
var c = o.c, k = couleur(c.nom, c.id), actif = G.cat === c.nom;
pc.appendChild(h('button', { type: 'button', 'aria-pressed': actif ? 'true' : 'false', class: 'puce' + (k === 0 ? ' vide' : '') + (k > 0 ? ' t' + k : ''), onclick: function () { G.cat = actif ? null : c.nom; rendre(); } },
h('span', { class: 'pt c' + k, 'aria-hidden': 'true' }), h('span', { text: c.nom }), h('span', { class: 'n', text: d2(cc[c.nom] || 0) })));
});
+2 -2
View File
@@ -10,7 +10,7 @@
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="stylesheet" href="/static/fonts.css">
<link rel="stylesheet" href="/static/nyora.css">
<link rel="stylesheet" href="/static/app.css?v=20261117c">
<link rel="stylesheet" href="/static/app.css?v=20261117d">
</head>
<body>
<div id="app" class="coque">
@@ -20,6 +20,6 @@
</div>
<div id="calque"></div>
<div id="annonce" class="sr" role="status" aria-live="polite"></div>
<script src="/static/app.js?v=20261117c"></script>
<script src="/static/app.js?v=20261117d"></script>
</body>
</html>