From 73d47fb90b2e40a3ccce7fadce120f779ade024d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 14:54:30 +0000 Subject: [PATCH 1/3] Initial plan From 5205cf20057dceb38e7a00124e0e855ff74c7651 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 14:58:57 +0000 Subject: [PATCH 2/3] Fix: Implement proper 'Mais Recentes' sorting for cantorias list Co-authored-by: lucis <18706156+lucis@users.noreply.github.com> --- view/src/routes/cantorias.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/view/src/routes/cantorias.tsx b/view/src/routes/cantorias.tsx index 873a001..3461b19 100644 --- a/view/src/routes/cantorias.tsx +++ b/view/src/routes/cantorias.tsx @@ -34,21 +34,23 @@ function CantoriasPage() { } // Ordenação primária - if (sortBy === "alfabetica") { + if (sortBy === "recentes") { + // Inverte a ordem do array (último adicionado = mais recente) + filtered.reverse(); + } else if (sortBy === "alfabetica") { filtered.sort((a, b) => a.titulo.localeCompare(b.titulo)); } else if (sortBy === "estilo") { filtered.sort((a, b) => a.estilo.nome.localeCompare(b.estilo.nome)); } else if (sortBy === "destaque") { filtered.sort((a, b) => (b.destaque ? 1 : 0) - (a.destaque ? 1 : 0)); + // Ordenação secundária: colocar cantorias COM vídeo primeiro apenas no modo destaque + filtered.sort((a, b) => { + const aTemVideo = a.links.youtube ? 1 : 0; + const bTemVideo = b.links.youtube ? 1 : 0; + return bTemVideo - aTemVideo; // Com vídeo primeiro + }); } - // Ordenação secundária: sempre colocar cantorias COM vídeo primeiro - filtered.sort((a, b) => { - const aTemVideo = a.links.youtube ? 1 : 0; - const bTemVideo = b.links.youtube ? 1 : 0; - return bTemVideo - aTemVideo; // Com vídeo primeiro - }); - return filtered; }, [cantorias, filterEstilo, sortBy]); From 0cca3004c7274e67249fd27e152a6efbb41fd452 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 16 Nov 2025 15:00:25 +0000 Subject: [PATCH 3/3] docs: Document chronological ordering in index.json Co-authored-by: lucis <18706156+lucis@users.noreply.github.com> --- DATA-MODEL.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DATA-MODEL.md b/DATA-MODEL.md index 494b0ff..722d71e 100644 --- a/DATA-MODEL.md +++ b/DATA-MODEL.md @@ -31,6 +31,8 @@ public/data/ Lista leve com metadados básicos. Use este para listar cantorias sem carregar estrofes. +**⚠️ IMPORTANTE - Ordenação:** A ordem dos itens no array `cantorias` é **cronológica** (primeira = mais antiga, última = mais recente). Para exibir as mais recentes primeiro, inverta a ordem do array com `.reverse()`. + ```json { "$schema": "https://json-schema.org/draft-07/schema#",