From 16ccd7ace5984676091cda037f5ac749a10d55de Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 24 Sep 2026 11:38:08 -0300 Subject: [PATCH 01/39] docs: link canonical brand guidelines from footer --- source/_layouts/footer.blade.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/_layouts/footer.blade.php b/source/_layouts/footer.blade.php index dc9b1c61..eff02d24 100644 --- a/source/_layouts/footer.blade.php +++ b/source/_layouts/footer.blade.php @@ -129,6 +129,9 @@
  • {{ $page->t("Privacy Policy")}}
  • +
  • + {{ $page->t("Brand and pronunciation")}} +
  • From 4ecc7fca6556a53b7cd6807fb726a0d64e5177bd Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 24 Sep 2026 12:04:08 -0300 Subject: [PATCH 02/39] docs: point brand link to LibreSign brand page --- source/_layouts/footer.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_layouts/footer.blade.php b/source/_layouts/footer.blade.php index eff02d24..0f1e6d60 100644 --- a/source/_layouts/footer.blade.php +++ b/source/_layouts/footer.blade.php @@ -130,7 +130,7 @@ {{ $page->t("Privacy Policy")}}
  • - {{ $page->t("Brand and pronunciation")}} + {{ $page->t("Brand and pronunciation")}}
  • From bdf47c708ea8d090714770d9bb32e5728dafaf52 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 24 Sep 2026 12:04:11 -0300 Subject: [PATCH 03/39] docs: add LibreSign brand and pronunciation page --- source/brand.blade.php | 75 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 source/brand.blade.php diff --git a/source/brand.blade.php b/source/brand.blade.php new file mode 100644 index 00000000..d7deb6af --- /dev/null +++ b/source/brand.blade.php @@ -0,0 +1,75 @@ +--- +title: "LibreSign Brand and Pronunciation" +description: "Official guidance for the LibreSign name, pronunciation, visual identity resources, and relationship to the LibreCode Co-op brand family." +--- +@extends('_layouts.main') + +@section('body') + @include('_partials.home.hero-section', [ + 'title' => $page->t('LibreSign brand and pronunciation'), + 'description' => $page->t('The official reference for how to write, pronounce, and identify LibreSign.'), + 'actions' => [], + ]) + +
    +
    +
    +
    +
    +

    {{ $page->t('The name') }}

    +

    {{ $page->t('Always write LibreSign with an uppercase L and S, with no space between Libre and Sign.') }}

    +

    {{ $page->t('Avoid spellings such as Libresign, Libre Sign, or libreSign.') }}

    +

    {{ $page->t('LibreSign was named after LibreCode, which in turn was inspired by LibreOffice. Libre refers to freedom and the free-software tradition.') }}

    +
    +
    + +
    +
    +

    {{ $page->t('Pronunciation') }}

    +

    Libre: /ˈli.bɾe/. {{ $page->t('It begins with an ee sound, not “lye” as in “laibre”.') }}

    +

    LibreSign: /ˈli.bɾe saɪn/.

    +

    {{ $page->t('Sign keeps its English pronunciation. The pronunciation follows the same Libre identity used across the LibreCode brand family.') }}

    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +

    {{ $page->t('Visual identity resources') }}

    +

    {{ $page->t('Approved logos, variations, and brand-manual materials are available in the public LibreSign brand folder.') }}

    +

    + + {{ $page->t('Open LibreSign brand assets') }} + +

    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    {{ $page->t('Part of the LibreCode Co-op brand family') }}

    +

    {{ $page->t('LibreSign has its own product identity, while shared naming and brand-family guidance is maintained by LibreCode Co-op as the canonical institutional reference.') }}

    + + {{ $page->t('See the LibreCode Co-op brand guidelines') }} + +
    +
    +
    +
    +
    +@endsection From a670ac4d3273a2539436bfb5ba16612ea52d2fd8 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 24 Sep 2026 12:11:26 -0300 Subject: [PATCH 04/39] docs: use official LibreCode Coop spelling --- source/brand.blade.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/brand.blade.php b/source/brand.blade.php index d7deb6af..cf10a912 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -1,6 +1,6 @@ --- title: "LibreSign Brand and Pronunciation" -description: "Official guidance for the LibreSign name, pronunciation, visual identity resources, and relationship to the LibreCode Co-op brand family." +description: "Official guidance for the LibreSign name, pronunciation, visual identity resources, and relationship to the LibreCode Coop brand family." --- @extends('_layouts.main') @@ -59,13 +59,13 @@
    -

    {{ $page->t('Part of the LibreCode Co-op brand family') }}

    -

    {{ $page->t('LibreSign has its own product identity, while shared naming and brand-family guidance is maintained by LibreCode Co-op as the canonical institutional reference.') }}

    +

    {{ $page->t('Part of the LibreCode Coop brand family') }}

    +

    {{ $page->t('LibreSign has its own product identity, while shared naming and brand-family guidance is maintained by LibreCode Coop as the canonical institutional reference.') }}

    - {{ $page->t('See the LibreCode Co-op brand guidelines') }} + {{ $page->t('See the LibreCode Coop brand guidelines') }}
    From 5fce487fac2a4fe783cc3a1af40d72a216a4c4cc Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 24 Sep 2026 12:22:03 -0300 Subject: [PATCH 05/39] docs: focus LibreSign brand page on product identity and freedom --- source/brand.blade.php | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/source/brand.blade.php b/source/brand.blade.php index cf10a912..441d5241 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -1,6 +1,6 @@ --- title: "LibreSign Brand and Pronunciation" -description: "Official guidance for the LibreSign name, pronunciation, visual identity resources, and relationship to the LibreCode Coop brand family." +description: "Official guidance for the LibreSign name, pronunciation, and visual identity." --- @extends('_layouts.main') @@ -19,7 +19,6 @@

    {{ $page->t('The name') }}

    {{ $page->t('Always write LibreSign with an uppercase L and S, with no space between Libre and Sign.') }}

    {{ $page->t('Avoid spellings such as Libresign, Libre Sign, or libreSign.') }}

    -

    {{ $page->t('LibreSign was named after LibreCode, which in turn was inspired by LibreOffice. Libre refers to freedom and the free-software tradition.') }}

    @@ -27,8 +26,7 @@

    {{ $page->t('Pronunciation') }}

    Libre: /ˈli.bɾe/. {{ $page->t('It begins with an ee sound, not “lye” as in “laibre”.') }}

    -

    LibreSign: /ˈli.bɾe saɪn/.

    -

    {{ $page->t('Sign keeps its English pronunciation. The pronunciation follows the same Libre identity used across the LibreCode brand family.') }}

    +

    LibreSign: /ˈli.bɾe saɪn/. {{ $page->t('Sign keeps its English pronunciation.') }}

    @@ -39,34 +37,30 @@
    -

    {{ $page->t('Visual identity resources') }}

    -

    {{ $page->t('Approved logos, variations, and brand-manual materials are available in the public LibreSign brand folder.') }}

    -

    - - {{ $page->t('Open LibreSign brand assets') }} - -

    +

    {{ $page->t('Why “Libre” matters') }}

    +

    {{ $page->t('Libre means freedom. With LibreSign, that means the freedom to run your own signing infrastructure, keep control of documents and data, inspect and adapt the software, integrate it with your environment, and avoid being locked into a single proprietary service.') }}

    +

    {{ $page->t('For organizations, that freedom supports data sovereignty, interoperability, continuity, and the ability to choose how and by whom the solution is operated and maintained.') }}

    -
    +
    -

    {{ $page->t('Part of the LibreCode Coop brand family') }}

    -

    {{ $page->t('LibreSign has its own product identity, while shared naming and brand-family guidance is maintained by LibreCode Coop as the canonical institutional reference.') }}

    - - {{ $page->t('See the LibreCode Coop brand guidelines') }} - +

    {{ $page->t('Official LibreSign assets') }}

    +

    {{ $page->t('Use official, versioned assets and preserve their proportions and visual integrity.') }}

    +

    + + {{ $page->t('Download LibreSign logo (SVG)') }} + + + {{ $page->t('Download LibreSign logo (PNG)') }} + +

    +

    {{ $page->t('Complete visual specifications — variants, colors, clear space, minimum sizes, and incorrect uses — will be maintained as versioned brand documentation and published here.') }}

    From 3b86d23b3ba66f92ba011e65e445f13ec9a0d526 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 24 Sep 2026 12:45:33 -0300 Subject: [PATCH 06/39] docs: reference canonical brand repository --- source/brand.blade.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/brand.blade.php b/source/brand.blade.php index 441d5241..6c8e8c42 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -51,7 +51,7 @@

    {{ $page->t('Official LibreSign assets') }}

    -

    {{ $page->t('Use official, versioned assets and preserve their proportions and visual integrity.') }}

    +

    {{ $page->t('Use official, versioned assets and preserve their proportions and visual integrity.') }} {{ $page->t('The canonical source for LibreSign brand rules and assets is versioned in the public brand repository.') }}

    {{ $page->t('Download LibreSign logo (SVG)') }} @@ -60,7 +60,8 @@ {{ $page->t('Download LibreSign logo (PNG)') }}

    -

    {{ $page->t('Complete visual specifications — variants, colors, clear space, minimum sizes, and incorrect uses — will be maintained as versioned brand documentation and published here.') }}

    +

    {{ $page->t('Complete visual specifications — variants, colors, clear space, minimum sizes, and incorrect uses — are maintained as versioned brand documentation and published here.') }}

    +

    {{ $page->t('View canonical brand source') }}

    From 685089a4b22f21204b8afc62845047f8aa523736 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 24 Sep 2026 14:58:46 -0300 Subject: [PATCH 07/39] docs: align public brand page with reconciled brand system --- source/brand.blade.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/brand.blade.php b/source/brand.blade.php index 6c8e8c42..61c1b156 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -60,7 +60,8 @@ {{ $page->t('Download LibreSign logo (PNG)') }}

    -

    {{ $page->t('Complete visual specifications — variants, colors, clear space, minimum sizes, and incorrect uses — are maintained as versioned brand documentation and published here.') }}

    +

    {{ $page->t('The core identity preserves the approved logo geometry, variants, clear space, and minimum sizes. The current website uses #184c4e as its primary digital color and Montserrat as its UI typeface; these belong to the digital design-system layer and do not rewrite historical logo artwork.') }}

    +

    {{ $page->t('The historical manual has been reviewed and is being rebuilt from open, reproducible source. Administrative documents and historical files containing personal information are intentionally excluded from the public brand repository.') }}

    {{ $page->t('View canonical brand source') }}

    From 8fbea31c27d291d033722c229571943d76ea673e Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 24 Sep 2026 15:09:28 -0300 Subject: [PATCH 08/39] docs: remove migration language from public brand guide --- source/brand.blade.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/brand.blade.php b/source/brand.blade.php index 61c1b156..6a8fddc0 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -61,8 +61,7 @@

    {{ $page->t('The core identity preserves the approved logo geometry, variants, clear space, and minimum sizes. The current website uses #184c4e as its primary digital color and Montserrat as its UI typeface; these belong to the digital design-system layer and do not rewrite historical logo artwork.') }}

    -

    {{ $page->t('The historical manual has been reviewed and is being rebuilt from open, reproducible source. Administrative documents and historical files containing personal information are intentionally excluded from the public brand repository.') }}

    -

    {{ $page->t('View canonical brand source') }}

    +

    {{ $page->t('View canonical brand source') }}

    From b9f257c76a77cf5c7c8435245a1efc7981b089b9 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 24 Sep 2026 15:24:21 -0300 Subject: [PATCH 09/39] docs: link stable latest brand manual PDF --- source/brand.blade.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/brand.blade.php b/source/brand.blade.php index 6a8fddc0..a50253e2 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -61,7 +61,12 @@

    {{ $page->t('The core identity preserves the approved logo geometry, variants, clear space, and minimum sizes. The current website uses #184c4e as its primary digital color and Montserrat as its UI typeface; these belong to the digital design-system layer and do not rewrite historical logo artwork.') }}

    -

    {{ $page->t('View canonical brand source') }}

    +

    + + {{ $page->t('Download latest brand manual (PDF)') }} + + {{ $page->t('View canonical brand source') }} +

    From 54bc67f05fb7fe1786ea4f2cbe607632dd89751e Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 24 Sep 2026 15:26:02 -0300 Subject: [PATCH 10/39] docs: use stable latest brand manual URL --- source/brand.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/brand.blade.php b/source/brand.blade.php index a50253e2..d3be57a7 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -62,7 +62,7 @@

    {{ $page->t('The core identity preserves the approved logo geometry, variants, clear space, and minimum sizes. The current website uses #184c4e as its primary digital color and Montserrat as its UI typeface; these belong to the digital design-system layer and do not rewrite historical logo artwork.') }}

    - + {{ $page->t('Download latest brand manual (PDF)') }} {{ $page->t('View canonical brand source') }} From d9edf0f7c468c7d43c25692a430aeb05e0e252b5 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 15:38:01 -0300 Subject: [PATCH 11/39] docs: align brand page with canonical brand system Signed-off-by: Vitor Mattos --- source/brand.blade.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/brand.blade.php b/source/brand.blade.php index d3be57a7..27485987 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -40,6 +40,7 @@

    {{ $page->t('Why “Libre” matters') }}

    {{ $page->t('Libre means freedom. With LibreSign, that means the freedom to run your own signing infrastructure, keep control of documents and data, inspect and adapt the software, integrate it with your environment, and avoid being locked into a single proprietary service.') }}

    {{ $page->t('For organizations, that freedom supports data sovereignty, interoperability, continuity, and the ability to choose how and by whom the solution is operated and maintained.') }}

    +

    {{ $page->t('Brand promise:') }} {{ $page->t('Freedom and control for electronic signing.') }}

    @@ -53,17 +54,17 @@

    {{ $page->t('Official LibreSign assets') }}

    {{ $page->t('Use official, versioned assets and preserve their proportions and visual integrity.') }} {{ $page->t('The canonical source for LibreSign brand rules and assets is versioned in the public brand repository.') }}

    - + {{ $page->t('Download LibreSign logo (SVG)') }} - + {{ $page->t('Download LibreSign logo (PNG)') }}

    -

    {{ $page->t('The core identity preserves the approved logo geometry, variants, clear space, and minimum sizes. The current website uses #184c4e as its primary digital color and Montserrat as its UI typeface; these belong to the digital design-system layer and do not rewrite historical logo artwork.') }}

    -

    +

    {{ $page->t('The current LibreSign digital brand system uses #184c4e as its primary teal and Montserrat as its official digital typeface. Do not infer logo colors from interface colors; always use the official artwork.') }}

    +

    - {{ $page->t('Download latest brand manual (PDF)') }} + {{ $page->t('Download current brand manual (PDF)') }} {{ $page->t('View canonical brand source') }}

    From 75bd3aa4c1f4ad3342a2caec4c343f40873d6d2d Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 15:43:43 -0300 Subject: [PATCH 12/39] refactor: give the brand page a clearer visual hierarchy Signed-off-by: Vitor Mattos --- source/brand.blade.php | 114 ++++++++++++++++++++++++----------------- 1 file changed, 68 insertions(+), 46 deletions(-) diff --git a/source/brand.blade.php b/source/brand.blade.php index 27485987..37046382 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -5,69 +5,91 @@ @extends('_layouts.main') @section('body') - @include('_partials.home.hero-section', [ - 'title' => $page->t('LibreSign brand and pronunciation'), - 'description' => $page->t('The official reference for how to write, pronounce, and identify LibreSign.'), - 'actions' => [], - ]) +
    +
    +
    +

    {{ $page->t('LibreSign brand') }}

    +

    {{ $page->t('Brand and pronunciation') }}

    +

    {{ $page->t('How to write, pronounce, and use the LibreSign identity correctly.') }}

    +
    +
    +
    -
    +
    -
    -
    -
    -

    {{ $page->t('The name') }}

    +
    +
    +
    +

    {{ $page->t('Official name') }}

    +

    LibreSign

    {{ $page->t('Always write LibreSign with an uppercase L and S, with no space between Libre and Sign.') }}

    -

    {{ $page->t('Avoid spellings such as Libresign, Libre Sign, or libreSign.') }}

    -
    +

    {{ $page->t('Avoid: Libresign, Libre Sign, libreSign.') }}

    +
    -
    -
    -

    {{ $page->t('Pronunciation') }}

    -

    Libre: /ˈli.bɾe/. {{ $page->t('It begins with an ee sound, not “lye” as in “laibre”.') }}

    -

    LibreSign: /ˈli.bɾe saɪn/. {{ $page->t('Sign keeps its English pronunciation.') }}

    -
    +
    +
    +

    {{ $page->t('Pronunciation') }}

    +

    /ˈli.bɾe saɪn/

    +

    Libre: /ˈli.bɾe/. {{ $page->t('It begins with an ee sound, not “lye”.') }}

    +

    Sign: {{ $page->t('Use the English pronunciation.') }}

    +
    -
    +
    -
    -
    -

    {{ $page->t('Why “Libre” matters') }}

    -

    {{ $page->t('Libre means freedom. With LibreSign, that means the freedom to run your own signing infrastructure, keep control of documents and data, inspect and adapt the software, integrate it with your environment, and avoid being locked into a single proprietary service.') }}

    -

    {{ $page->t('For organizations, that freedom supports data sovereignty, interoperability, continuity, and the ability to choose how and by whom the solution is operated and maintained.') }}

    -

    {{ $page->t('Brand promise:') }} {{ $page->t('Freedom and control for electronic signing.') }}

    +
    +
    + +

    {{ $page->t('Why “Libre” matters') }}

    +

    {{ $page->t('Libre means freedom. LibreSign gives organizations practical control over signing infrastructure, documents and data, integration, operation, and long-term maintenance.') }}

    +

    {{ $page->t('That freedom supports self-hosting, inspectable software, interoperability, adaptability, and continuity without dependence on a single proprietary signing service.') }}

    +
    + {{ $page->t('Brand promise') }} + {{ $page->t('Freedom and control for electronic signing.') }} +
    -
    +
    -
    -
    -
    -

    {{ $page->t('Official LibreSign assets') }}

    -

    {{ $page->t('Use official, versioned assets and preserve their proportions and visual integrity.') }} {{ $page->t('The canonical source for LibreSign brand rules and assets is versioned in the public brand repository.') }}

    -

    - - {{ $page->t('Download LibreSign logo (SVG)') }} - - - {{ $page->t('Download LibreSign logo (PNG)') }} - -

    -

    {{ $page->t('The current LibreSign digital brand system uses #184c4e as its primary teal and Montserrat as its official digital typeface. Do not infer logo colors from interface colors; always use the official artwork.') }}

    -

    - - {{ $page->t('Download current brand manual (PDF)') }} - - {{ $page->t('View canonical brand source') }} -

    +
    +
    +
    + {{ $page->t('Official LibreSign logo') }} +
    +
    + +
    +
    + +

    {{ $page->t('Use the canonical LibreSign assets') }}

    +

    {{ $page->t('Use the official files from the public brand repository. Preserve the logo proportions, clear space, and visual integrity. Do not recreate the logo from screenshots or old exports.') }}

    + + + +
    +

    {{ $page->t('Digital system:') }} {{ $page->t('Primary teal #184c4e · Montserrat typeface.') }}

    +

    {{ $page->t('Interface colors are not logo colors. Always use the official artwork.') }}

    +
    + + + {{ $page->t('View the canonical brand source on GitHub') }} → +
    From 57623817f66794737f11e50453fc47db33346248 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 15:43:51 -0300 Subject: [PATCH 13/39] style: load brand page styles Signed-off-by: Vitor Mattos --- source/_assets/scss/ud-styles.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/source/_assets/scss/ud-styles.scss b/source/_assets/scss/ud-styles.scss index ff4b3e1a..6d9de9f0 100644 --- a/source/_assets/scss/ud-styles.scss +++ b/source/_assets/scss/ud-styles.scss @@ -16,6 +16,7 @@ @use "header" as *; @use "hero" as *; @use "about" as *; +@use "brand" as *; @use "pricing" as *; @use "testimonials" as *; @use "team" as *; From b31d019784eda71ab8c04bf05d1cf1a2c72ed18e Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 15:44:09 -0300 Subject: [PATCH 14/39] style: add dedicated brand page layout Signed-off-by: Vitor Mattos --- source/_assets/scss/_brand.scss | 212 ++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 source/_assets/scss/_brand.scss diff --git a/source/_assets/scss/_brand.scss b/source/_assets/scss/_brand.scss new file mode 100644 index 00000000..d9d17ffe --- /dev/null +++ b/source/_assets/scss/_brand.scss @@ -0,0 +1,212 @@ +@use "variables" as *; + +.ud-brand-banner { + padding-top: 118px; + padding-bottom: 64px; + + .ud-banner-content { + max-width: 760px; + } + + &__eyebrow { + color: rgba(255, 255, 255, 0.78) !important; + font-size: 0.88rem !important; + font-weight: 700; + letter-spacing: 0.09em; + margin: 0 0 12px !important; + text-transform: uppercase; + } + + h1 { + font-size: clamp(2.3rem, 4vw, 3.6rem); + font-weight: 800; + letter-spacing: -0.03em; + } +} + +.ud-brand-basics { + background: var(--bg-light); + padding: 72px 0; +} + +.ud-brand-card { + background: var(--white); + border: 1px solid var(--border-light); + border-radius: 18px; + box-shadow: 0 16px 40px rgba(18, 60, 64, 0.07); + padding: 34px; + + &__label, + .ud-brand-card__label { + color: var(--primary-color); + font-size: 0.82rem; + font-weight: 700; + letter-spacing: 0.08em; + margin-bottom: 10px; + text-transform: uppercase; + } + + h2 { + color: var(--text-gray); + font-size: clamp(1.8rem, 2.7vw, 2.4rem); + margin-bottom: 16px; + } + + p { + color: var(--text-muted); + line-height: 1.72; + } + + &__note { + border-top: 1px solid var(--border-light); + margin-top: 20px; + padding-top: 16px; + } +} + +.ud-brand-section-label { + color: var(--primary-color); + font-size: 0.82rem; + font-weight: 700; + letter-spacing: 0.08em; + margin-bottom: 10px; + text-transform: uppercase; +} + +.ud-brand-meaning { + background: var(--surface-dark); + color: var(--white); + padding: 78px 0; + + .ud-brand-section-label { + color: rgba(255, 255, 255, 0.72); + } + + h2 { + color: var(--white); + font-size: var(--fs-h2-section); + margin-bottom: 20px; + } + + p { + color: rgba(255, 255, 255, 0.9); + line-height: 1.75; + margin: 0 auto 14px; + max-width: 900px; + } +} + +.ud-brand-promise { + align-items: center; + background: rgba(255, 255, 255, 0.08); + border: 1px solid rgba(255, 255, 255, 0.18); + border-radius: 14px; + display: inline-flex; + flex-direction: column; + gap: 5px; + margin-top: 26px; + padding: 18px 28px; + + span { + color: rgba(255, 255, 255, 0.72); + font-size: 0.78rem; + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; + } + + strong { + color: var(--white); + font-size: clamp(1.15rem, 2vw, 1.45rem); + } +} + +.ud-brand-assets { + background: var(--bg-light); + padding: 86px 0; + + &__preview { + align-items: center; + background: var(--white); + border: 1px solid var(--border-light); + border-radius: 22px; + display: flex; + min-height: 310px; + justify-content: center; + padding: 44px; + + img { + height: auto; + max-width: 320px; + width: 100%; + } + } + + &__content { + h2 { + color: var(--text-gray); + font-size: var(--fs-h2-section); + margin-bottom: 18px; + } + + > p { + color: var(--text-muted); + line-height: 1.72; + } + } + + &__actions { + display: flex; + flex-wrap: wrap; + gap: 12px; + margin: 28px 0; + } + + &__meta { + border-left: 3px solid var(--primary-color); + margin: 8px 0 24px; + padding-left: 16px; + + p { + color: var(--text-muted); + font-size: 0.95rem; + line-height: 1.6; + margin-bottom: 4px; + } + } +} + +.ud-brand-source-link { + color: var(--primary-color); + font-weight: 700; + + &:hover { + color: var(--primary-hover); + } +} + +@media #{$xs, $sm} { + .ud-brand-banner { + padding-top: 96px; + padding-bottom: 52px; + } + + .ud-brand-basics, + .ud-brand-meaning, + .ud-brand-assets { + padding: 56px 0; + } + + .ud-brand-card { + padding: 26px; + } + + .ud-brand-assets__preview { + min-height: 240px; + padding: 30px; + } + + .ud-brand-assets__actions .btn { + width: 100%; + } +} From d185befc7095408e8978ef5d1a9856dcfc3671ef Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:04:43 -0300 Subject: [PATCH 15/39] fix: correct brand preview and add accessible pronunciation control Signed-off-by: Vitor Mattos --- source/brand.blade.php | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/source/brand.blade.php b/source/brand.blade.php index 37046382..3a0b28b6 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -30,9 +30,30 @@

    {{ $page->t('Pronunciation') }}

    -

    /ˈli.bɾe saɪn/

    -

    Libre: /ˈli.bɾe/. {{ $page->t('It begins with an ee sound, not “lye”.') }}

    -

    Sign: {{ $page->t('Use the English pronunciation.') }}

    +

    + + {{ $page->t('LibreSign pronunciation') }} +

    +

    + Libre: + {{ $page->t('stress the first syllable; it begins with an ee sound') }}. + {{ $page->t('It begins with an ee sound, not “lye”.') }} +

    +

    Sign: {{ $page->t('Use the English pronunciation.') }}

    + +

    + {{ $page->t('Playback uses speech voices installed in your browser or device, so the voice may vary slightly. The written pronunciation above remains the reference.') }} +

    +

    @@ -62,8 +83,8 @@
    {{ $page->t('Official LibreSign logo') }} From 0a57eba9c1830234073a67522afc25c8a6132a69 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:04:57 -0300 Subject: [PATCH 16/39] feat: add progressive pronunciation playback Signed-off-by: Vitor Mattos --- source/_assets/js/brand-pronunciation.js | 60 ++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 source/_assets/js/brand-pronunciation.js diff --git a/source/_assets/js/brand-pronunciation.js b/source/_assets/js/brand-pronunciation.js new file mode 100644 index 00000000..a0acfe81 --- /dev/null +++ b/source/_assets/js/brand-pronunciation.js @@ -0,0 +1,60 @@ +const button = document.querySelector('[data-brand-pronunciation]'); +const status = document.querySelector('[data-brand-pronunciation-status]'); + +if (button && status && 'speechSynthesis' in window && 'SpeechSynthesisUtterance' in window) { + const synth = window.speechSynthesis; + + const pickVoice = (language) => { + const prefix = language.toLowerCase().split('-')[0]; + return synth.getVoices().find((voice) => voice.lang.toLowerCase().startsWith(prefix)); + }; + + const makeUtterance = (text, language) => { + const utterance = new SpeechSynthesisUtterance(text); + utterance.lang = language; + utterance.rate = 0.9; + + const voice = pickVoice(language); + if (voice) { + utterance.voice = voice; + } + + return utterance; + }; + + const reset = () => { + button.disabled = false; + button.removeAttribute('aria-busy'); + }; + + button.hidden = false; + + button.addEventListener('click', () => { + synth.cancel(); + button.disabled = true; + button.setAttribute('aria-busy', 'true'); + status.textContent = 'Playing LibreSign pronunciation.'; + + // "Libre" follows the Romance-language reading documented by the brand, + // while "Sign" keeps its English pronunciation. + const libre = makeUtterance('Libre', 'es'); + const sign = makeUtterance('sign', 'en'); + + libre.addEventListener('end', () => synth.speak(sign), { once: true }); + libre.addEventListener('error', () => { + status.textContent = 'Pronunciation playback is not available on this device.'; + reset(); + }, { once: true }); + + sign.addEventListener('end', () => { + status.textContent = 'Pronunciation playback finished.'; + reset(); + }, { once: true }); + sign.addEventListener('error', () => { + status.textContent = 'Pronunciation playback is not available on this device.'; + reset(); + }, { once: true }); + + synth.speak(libre); + }); +} From 32c14fca050fff719b18ffd48187240dba354923 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:05:04 -0300 Subject: [PATCH 17/39] build: load brand pronunciation behavior Signed-off-by: Vitor Mattos --- source/_assets/js/main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/source/_assets/js/main.js b/source/_assets/js/main.js index a2d0bbe6..685029b9 100644 --- a/source/_assets/js/main.js +++ b/source/_assets/js/main.js @@ -1,3 +1,4 @@ +import './brand-pronunciation.js'; import 'bootstrap/dist/js/bootstrap.bundle.min.js'; import 'animate.css'; From d460db0daf47547055857db708ffa000e5347eec Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:05:23 -0300 Subject: [PATCH 18/39] style: refine accessible pronunciation control Signed-off-by: Vitor Mattos --- source/_assets/scss/_brand.scss | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/_assets/scss/_brand.scss b/source/_assets/scss/_brand.scss index d9d17ffe..c9ecd4f5 100644 --- a/source/_assets/scss/_brand.scss +++ b/source/_assets/scss/_brand.scss @@ -64,6 +64,24 @@ } } + +.ud-brand-pronunciation { + &__button { + align-items: center; + display: inline-flex; + gap: 9px; + margin-top: 8px; + } + + &__note { + color: var(--text-muted); + font-size: 0.88rem; + line-height: 1.55; + margin-top: 14px; + max-width: 36rem; + } +} + .ud-brand-section-label { color: var(--primary-color); font-size: 0.82rem; From 188e89961fe4870fc546a09e09ab116a06c609a1 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:10:17 -0300 Subject: [PATCH 19/39] refactor: make pronunciation playback testable Signed-off-by: Vitor Mattos --- source/_assets/js/brand-pronunciation.mjs | 79 +++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 source/_assets/js/brand-pronunciation.mjs diff --git a/source/_assets/js/brand-pronunciation.mjs b/source/_assets/js/brand-pronunciation.mjs new file mode 100644 index 00000000..7fe9aa7a --- /dev/null +++ b/source/_assets/js/brand-pronunciation.mjs @@ -0,0 +1,79 @@ +export function pickVoice(voices, language) { + const prefix = language.toLowerCase().split('-')[0]; + return voices.find((voice) => voice.lang.toLowerCase().startsWith(prefix)); +} + +export function createPronunciationController({ button, status, synth, Utterance }) { + const makeUtterance = (text, language) => { + const utterance = new Utterance(text); + utterance.lang = language; + utterance.rate = 0.9; + + const voice = pickVoice(synth.getVoices(), language); + if (voice) { + utterance.voice = voice; + } + + return utterance; + }; + + const reset = () => { + button.disabled = false; + button.removeAttribute('aria-busy'); + }; + + const play = () => { + synth.cancel(); + button.disabled = true; + button.setAttribute('aria-busy', 'true'); + status.textContent = 'Playing LibreSign pronunciation.'; + + const libre = makeUtterance('Libre', 'es'); + const sign = makeUtterance('sign', 'en'); + + libre.addEventListener('end', () => synth.speak(sign), { once: true }); + libre.addEventListener('error', () => { + status.textContent = 'Pronunciation playback is not available on this device.'; + reset(); + }, { once: true }); + + sign.addEventListener('end', () => { + status.textContent = 'Pronunciation playback finished.'; + reset(); + }, { once: true }); + sign.addEventListener('error', () => { + status.textContent = 'Pronunciation playback is not available on this device.'; + reset(); + }, { once: true }); + + synth.speak(libre); + }; + + button.hidden = false; + button.addEventListener('click', play); + + return { play }; +} + +export function initBrandPronunciation({ documentRef = document, windowRef = window } = {}) { + const button = documentRef.querySelector('[data-brand-pronunciation]'); + const status = documentRef.querySelector('[data-brand-pronunciation-status]'); + + if ( + !button || + !status || + !('speechSynthesis' in windowRef) || + !('SpeechSynthesisUtterance' in windowRef) + ) { + return false; + } + + createPronunciationController({ + button, + status, + synth: windowRef.speechSynthesis, + Utterance: windowRef.SpeechSynthesisUtterance, + }); + + return true; +} From f5cc4cb5a92779e5ebbd17c5cb0de0f75c471fe1 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:10:25 -0300 Subject: [PATCH 20/39] refactor: initialize tested pronunciation module Signed-off-by: Vitor Mattos --- source/_assets/js/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/_assets/js/main.js b/source/_assets/js/main.js index 685029b9..1564a889 100644 --- a/source/_assets/js/main.js +++ b/source/_assets/js/main.js @@ -1,7 +1,9 @@ -import './brand-pronunciation.js'; +import { initBrandPronunciation } from './brand-pronunciation.mjs'; import 'bootstrap/dist/js/bootstrap.bundle.min.js'; import 'animate.css'; +initBrandPronunciation(); + import AOS from 'aos'; const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; AOS.init({ From c5006b3ea2a30ed589686f7b61b1162387dddb3a Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:10:27 -0300 Subject: [PATCH 21/39] refactor: replace pronunciation script with module Signed-off-by: Vitor Mattos --- source/_assets/js/brand-pronunciation.js | 60 ------------------------ 1 file changed, 60 deletions(-) delete mode 100644 source/_assets/js/brand-pronunciation.js diff --git a/source/_assets/js/brand-pronunciation.js b/source/_assets/js/brand-pronunciation.js deleted file mode 100644 index a0acfe81..00000000 --- a/source/_assets/js/brand-pronunciation.js +++ /dev/null @@ -1,60 +0,0 @@ -const button = document.querySelector('[data-brand-pronunciation]'); -const status = document.querySelector('[data-brand-pronunciation-status]'); - -if (button && status && 'speechSynthesis' in window && 'SpeechSynthesisUtterance' in window) { - const synth = window.speechSynthesis; - - const pickVoice = (language) => { - const prefix = language.toLowerCase().split('-')[0]; - return synth.getVoices().find((voice) => voice.lang.toLowerCase().startsWith(prefix)); - }; - - const makeUtterance = (text, language) => { - const utterance = new SpeechSynthesisUtterance(text); - utterance.lang = language; - utterance.rate = 0.9; - - const voice = pickVoice(language); - if (voice) { - utterance.voice = voice; - } - - return utterance; - }; - - const reset = () => { - button.disabled = false; - button.removeAttribute('aria-busy'); - }; - - button.hidden = false; - - button.addEventListener('click', () => { - synth.cancel(); - button.disabled = true; - button.setAttribute('aria-busy', 'true'); - status.textContent = 'Playing LibreSign pronunciation.'; - - // "Libre" follows the Romance-language reading documented by the brand, - // while "Sign" keeps its English pronunciation. - const libre = makeUtterance('Libre', 'es'); - const sign = makeUtterance('sign', 'en'); - - libre.addEventListener('end', () => synth.speak(sign), { once: true }); - libre.addEventListener('error', () => { - status.textContent = 'Pronunciation playback is not available on this device.'; - reset(); - }, { once: true }); - - sign.addEventListener('end', () => { - status.textContent = 'Pronunciation playback finished.'; - reset(); - }, { once: true }); - sign.addEventListener('error', () => { - status.textContent = 'Pronunciation playback is not available on this device.'; - reset(); - }, { once: true }); - - synth.speak(libre); - }); -} From 49ed7bd5e872c7026634d2039b536abeab5f0828 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:10:44 -0300 Subject: [PATCH 22/39] test: cover brand pronunciation playback Signed-off-by: Vitor Mattos --- tests/js/brand-pronunciation.test.mjs | 187 ++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 tests/js/brand-pronunciation.test.mjs diff --git a/tests/js/brand-pronunciation.test.mjs b/tests/js/brand-pronunciation.test.mjs new file mode 100644 index 00000000..e3ddfddc --- /dev/null +++ b/tests/js/brand-pronunciation.test.mjs @@ -0,0 +1,187 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; + +import { + createPronunciationController, + initBrandPronunciation, + pickVoice, +} from '../../source/_assets/js/brand-pronunciation.mjs'; + +class FakeUtterance { + constructor(text) { + this.text = text; + this.lang = ''; + this.rate = 1; + this.voice = null; + this.listeners = new Map(); + } + + addEventListener(type, callback) { + this.listeners.set(type, callback); + } + + emit(type) { + const callback = this.listeners.get(type); + if (callback) { + callback(); + } + } +} + +function makeButton() { + const listeners = new Map(); + const attributes = new Map(); + + return { + hidden: true, + disabled: false, + addEventListener(type, callback) { + listeners.set(type, callback); + }, + click() { + listeners.get('click')?.(); + }, + setAttribute(name, value) { + attributes.set(name, value); + }, + removeAttribute(name) { + attributes.delete(name); + }, + getAttribute(name) { + return attributes.get(name); + }, + }; +} + +test('pickVoice matches the requested language prefix case-insensitively', () => { + const voices = [ + { lang: 'en-US', name: 'English' }, + { lang: 'ES-es', name: 'Spanish' }, + ]; + + assert.equal(pickVoice(voices, 'es-MX'), voices[1]); + assert.equal(pickVoice(voices, 'pt-BR'), undefined); +}); + +test('controller plays Libre first, then Sign, and restores the button', () => { + const button = makeButton(); + const status = { textContent: '' }; + const spoken = []; + let cancelled = 0; + + const synth = { + getVoices: () => [{ lang: 'es-ES' }, { lang: 'en-US' }], + cancel: () => { cancelled += 1; }, + speak: (utterance) => { spoken.push(utterance); }, + }; + + createPronunciationController({ + button, + status, + synth, + Utterance: FakeUtterance, + }); + + assert.equal(button.hidden, false); + + button.click(); + + assert.equal(cancelled, 1); + assert.equal(button.disabled, true); + assert.equal(button.getAttribute('aria-busy'), 'true'); + assert.equal(status.textContent, 'Playing LibreSign pronunciation.'); + assert.equal(spoken.length, 1); + assert.equal(spoken[0].text, 'Libre'); + assert.equal(spoken[0].lang, 'es'); + assert.equal(spoken[0].rate, 0.9); + + spoken[0].emit('end'); + + assert.equal(spoken.length, 2); + assert.equal(spoken[1].text, 'sign'); + assert.equal(spoken[1].lang, 'en'); + + spoken[1].emit('end'); + + assert.equal(status.textContent, 'Pronunciation playback finished.'); + assert.equal(button.disabled, false); + assert.equal(button.getAttribute('aria-busy'), undefined); +}); + +test('controller restores the button when playback fails', () => { + const button = makeButton(); + const status = { textContent: '' }; + const spoken = []; + + const synth = { + getVoices: () => [], + cancel: () => {}, + speak: (utterance) => { spoken.push(utterance); }, + }; + + createPronunciationController({ + button, + status, + synth, + Utterance: FakeUtterance, + }); + + button.click(); + spoken[0].emit('error'); + + assert.equal( + status.textContent, + 'Pronunciation playback is not available on this device.', + ); + assert.equal(button.disabled, false); + assert.equal(button.getAttribute('aria-busy'), undefined); +}); + +test('init does not expose the control when speech synthesis is unavailable', () => { + const button = makeButton(); + const status = { textContent: '' }; + const documentRef = { + querySelector(selector) { + if (selector === '[data-brand-pronunciation]') return button; + if (selector === '[data-brand-pronunciation-status]') return status; + return null; + }, + }; + + const initialized = initBrandPronunciation({ + documentRef, + windowRef: {}, + }); + + assert.equal(initialized, false); + assert.equal(button.hidden, true); +}); + +test('init exposes the control when speech synthesis is supported', () => { + const button = makeButton(); + const status = { textContent: '' }; + const documentRef = { + querySelector(selector) { + if (selector === '[data-brand-pronunciation]') return button; + if (selector === '[data-brand-pronunciation-status]') return status; + return null; + }, + }; + + const windowRef = { + speechSynthesis: { + getVoices: () => [], + cancel: () => {}, + speak: () => {}, + }, + SpeechSynthesisUtterance: FakeUtterance, + }; + + const initialized = initBrandPronunciation({ + documentRef, + windowRef, + }); + + assert.equal(initialized, true); + assert.equal(button.hidden, false); +}); From 2d506e8e563fb90dbb8537ba28fa047bac72cad1 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:10:51 -0300 Subject: [PATCH 23/39] test: add JavaScript test command Signed-off-by: Vitor Mattos --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 07551145..1c15a0d3 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "watch": "NODE_ENV=development vite build --watch", "build-assets": "NODE_ENV=local vite build", "staging": "NODE_ENV=staging vite build", - "prod": "NODE_ENV=production vite build" + "prod": "NODE_ENV=production vite build", + "test:js": "node --test tests/js/*.test.mjs" }, "devDependencies": { "@tighten/jigsaw-vite-plugin": "^2.0.0", From 20987b0d513b0dd4d698d057f32781b63f8d2707 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:10:58 -0300 Subject: [PATCH 24/39] ci: run JavaScript unit tests Signed-off-by: Vitor Mattos --- .github/workflows/javascript-tests.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/javascript-tests.yml diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml new file mode 100644 index 00000000..ec8a229a --- /dev/null +++ b/.github/workflows/javascript-tests.yml @@ -0,0 +1,26 @@ +name: JavaScript tests + +on: + pull_request: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Run JavaScript tests + run: npm run test:js From 5cb6c377a171c662d9ba8135485027a7c6119de1 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:11:06 -0300 Subject: [PATCH 25/39] style: remove artificial uppercase brand labels Signed-off-by: Vitor Mattos --- source/_assets/scss/_brand.scss | 6 ------ 1 file changed, 6 deletions(-) diff --git a/source/_assets/scss/_brand.scss b/source/_assets/scss/_brand.scss index c9ecd4f5..13b6ddac 100644 --- a/source/_assets/scss/_brand.scss +++ b/source/_assets/scss/_brand.scss @@ -12,9 +12,7 @@ color: rgba(255, 255, 255, 0.78) !important; font-size: 0.88rem !important; font-weight: 700; - letter-spacing: 0.09em; margin: 0 0 12px !important; - text-transform: uppercase; } h1 { @@ -41,9 +39,7 @@ color: var(--primary-color); font-size: 0.82rem; font-weight: 700; - letter-spacing: 0.08em; margin-bottom: 10px; - text-transform: uppercase; } h2 { @@ -129,8 +125,6 @@ color: rgba(255, 255, 255, 0.72); font-size: 0.78rem; font-weight: 700; - letter-spacing: 0.08em; - text-transform: uppercase; } strong { From 109148dcf095d9185a22db6ca70d97b704252f04 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:11:14 -0300 Subject: [PATCH 26/39] ci: wait for preview pages deployment Signed-off-by: Vitor Mattos --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index a74a5ba6..6dffed7c 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -68,5 +68,5 @@ jobs: pages-base-url: libresign.github.io/site-preview deploy-repository: LibreSign/site-preview preview-branch: main - wait-for-pages-deployment: false + wait-for-pages-deployment: true token: ${{ secrets.PREVIEW_TOKEN }} From c259dda65f49cdf3455c0638b6be1e7b63cdc061 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:11:16 -0300 Subject: [PATCH 27/39] ci: wait for preview pages deployment Signed-off-by: Vitor Mattos --- .github/workflows/preview-fork-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-fork-deploy.yml b/.github/workflows/preview-fork-deploy.yml index ef23bc5a..42cccaf2 100644 --- a/.github/workflows/preview-fork-deploy.yml +++ b/.github/workflows/preview-fork-deploy.yml @@ -83,6 +83,6 @@ jobs: pages-base-url: libresign.github.io/site-preview deploy-repository: LibreSign/site-preview preview-branch: main - wait-for-pages-deployment: false + wait-for-pages-deployment: true token: ${{ secrets.PREVIEW_TOKEN }} From cd9d6b3e5ca1de8bd71667dd67872bf811d919b0 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:11:46 -0300 Subject: [PATCH 28/39] a11y: improve pronunciation text for screen readers Signed-off-by: Vitor Mattos --- source/brand.blade.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/brand.blade.php b/source/brand.blade.php index 3a0b28b6..48c344f4 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -32,12 +32,11 @@

    {{ $page->t('Pronunciation') }}

    - {{ $page->t('LibreSign pronunciation') }} + {{ $page->t('LibreSign: Libre with stress on the first syllable, followed by the English word Sign.') }}

    Libre: - {{ $page->t('stress the first syllable; it begins with an ee sound') }}. - {{ $page->t('It begins with an ee sound, not “lye”.') }} + {{ $page->t('Stress the first syllable. It begins with an ee sound, not “lye”.') }}

    Sign: {{ $page->t('Use the English pronunciation.') }}

    From ded324a60415e6283a42bc981dddb244d2f52680 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:15:33 -0300 Subject: [PATCH 29/39] ci: verify preview is published before releasing deploy lock Signed-off-by: Vitor Mattos --- .github/workflows/preview.yml | 41 ++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 6dffed7c..49fd5daa 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -57,6 +57,7 @@ jobs: retention-days: 1 - name: Deploy internal preview + id: deploy_preview if: github.event.pull_request.head.repo.full_name == github.repository # Temporary LibreSign fork with the pr-number forwarding fix. # Replace with upstream once the fix is merged and released. @@ -68,5 +69,43 @@ jobs: pages-base-url: libresign.github.io/site-preview deploy-repository: LibreSign/site-preview preview-branch: main - wait-for-pages-deployment: true + wait-for-pages-deployment: false token: ${{ secrets.PREVIEW_TOKEN }} + + + - name: Wait for preview Pages publication + if: github.event.pull_request.head.repo.full_name == github.repository + env: + DEPLOYED_SHA: ${{ steps.deploy_preview.outputs.deployed-commit-sha }} + GH_TOKEN: ${{ secrets.PREVIEW_TOKEN }} + run: | + set -euo pipefail + + for attempt in $(seq 1 60); do + runs=$(curl -fsSL \ + -H "Authorization: Bearer $GH_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/LibreSign/site-preview/actions/runs?head_sha=$DEPLOYED_SHA&per_page=20") + + status=$(echo "$runs" | jq -r ' + [.workflow_runs[] | select(.name == "pages build and deployment")][0].status // "missing" + ') + conclusion=$(echo "$runs" | jq -r ' + [.workflow_runs[] | select(.name == "pages build and deployment")][0].conclusion // "" + ') + + if [ "$status" = "completed" ]; then + if [ "$conclusion" = "success" ]; then + exit 0 + fi + + echo "Pages deployment finished with conclusion: $conclusion" + exit 1 + fi + + echo "Waiting for Pages deployment of $DEPLOYED_SHA (status: $status, attempt: $attempt/60)" + sleep 10 + done + + echo "Timed out waiting for Pages deployment of $DEPLOYED_SHA" + exit 1 From 3ae89d9096139a6f1190ecf3de0b1b96854ec8dd Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:15:38 -0300 Subject: [PATCH 30/39] ci: verify preview is published before releasing deploy lock Signed-off-by: Vitor Mattos --- .github/workflows/preview-fork-deploy.yml | 41 ++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview-fork-deploy.yml b/.github/workflows/preview-fork-deploy.yml index 42cccaf2..070e963b 100644 --- a/.github/workflows/preview-fork-deploy.yml +++ b/.github/workflows/preview-fork-deploy.yml @@ -72,6 +72,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Deploy fork preview + id: deploy_preview if: steps.pr.outputs.number != '' && steps.pr_meta.outputs.should_deploy == 'true' # Temporary LibreSign fork: forwards explicit `pr-number` to the native # sticky PR comment in `workflow_run`; replace with upstream after merge/release. @@ -83,6 +84,44 @@ jobs: pages-base-url: libresign.github.io/site-preview deploy-repository: LibreSign/site-preview preview-branch: main - wait-for-pages-deployment: true + wait-for-pages-deployment: false token: ${{ secrets.PREVIEW_TOKEN }} + + + - name: Wait for preview Pages publication + if: steps.pr.outputs.number != '' && steps.pr_meta.outputs.should_deploy == 'true' + env: + DEPLOYED_SHA: ${{ steps.deploy_preview.outputs.deployed-commit-sha }} + GH_TOKEN: ${{ secrets.PREVIEW_TOKEN }} + run: | + set -euo pipefail + + for attempt in $(seq 1 60); do + runs=$(curl -fsSL \ + -H "Authorization: Bearer $GH_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/LibreSign/site-preview/actions/runs?head_sha=$DEPLOYED_SHA&per_page=20") + + status=$(echo "$runs" | jq -r ' + [.workflow_runs[] | select(.name == "pages build and deployment")][0].status // "missing" + ') + conclusion=$(echo "$runs" | jq -r ' + [.workflow_runs[] | select(.name == "pages build and deployment")][0].conclusion // "" + ') + + if [ "$status" = "completed" ]; then + if [ "$conclusion" = "success" ]; then + exit 0 + fi + + echo "Pages deployment finished with conclusion: $conclusion" + exit 1 + fi + + echo "Waiting for Pages deployment of $DEPLOYED_SHA (status: $status, attempt: $attempt/60)" + sleep 10 + done + + echo "Timed out waiting for Pages deployment of $DEPLOYED_SHA" + exit 1 From c29e6b8f005159f7cd5786fc54ee5a7344556059 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:20:16 -0300 Subject: [PATCH 31/39] ci: skip stale preview revisions Signed-off-by: Vitor Mattos --- .github/workflows/preview.yml | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 49fd5daa..5a4016a9 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -21,20 +21,46 @@ jobs: # Deliberately no `closed` handling: previews are kept as historical snapshots. - uses: actions/checkout@v4 + - name: Check whether this is still the latest PR revision + id: freshness + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + RUN_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: | + set -euo pipefail + + current_head=$(curl -fsSL \ + -H "Authorization: Bearer $GH_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" \ + | jq -r '.head.sha') + + if [ "$current_head" = "$RUN_HEAD_SHA" ]; then + echo "is_latest=true" >> "$GITHUB_OUTPUT" + else + echo "is_latest=false" >> "$GITHUB_OUTPUT" + echo "Skipping stale preview run for $RUN_HEAD_SHA; current PR head is $current_head" + fi + - name: Set up Node.js + if: steps.freshness.outputs.is_latest == 'true' uses: actions/setup-node@v4 with: node-version: 20 - name: Set up PHP 8.3 + if: steps.freshness.outputs.is_latest == 'true' uses: shivammathur/setup-php@v2 with: php-version: 8.3 - name: Install PHP dependencies + if: steps.freshness.outputs.is_latest == 'true' run: composer install - name: Adjust preview base URLs and config + if: steps.freshness.outputs.is_latest == 'true' run: | sed -i "s|libresign.coop|libresign.github.io|g" CNAME sed -i "s|baseUrl' => '/'|baseUrl' => 'https://LibreSign.github.io/site-preview/pr-preview/pr-${{ github.event.pull_request.number }}/'|g" config.php @@ -43,13 +69,14 @@ jobs: sed -i "/'matomo_container'/d" config.production.php - name: Build production site + if: steps.freshness.outputs.is_latest == 'true' env: WC_CONSUMER_KEY: ${{ secrets.WC_CONSUMER_KEY }} WC_CONSUMER_SECRET: ${{ secrets.WC_CONSUMER_SECRET }} run: composer prod - name: Upload fork preview artifact - if: github.event.pull_request.head.repo.full_name != github.repository + if: steps.freshness.outputs.is_latest == 'true' && github.event.pull_request.head.repo.full_name != github.repository uses: actions/upload-artifact@v4 with: name: preview-build-fork @@ -58,7 +85,7 @@ jobs: - name: Deploy internal preview id: deploy_preview - if: github.event.pull_request.head.repo.full_name == github.repository + if: steps.freshness.outputs.is_latest == 'true' && github.event.pull_request.head.repo.full_name == github.repository # Temporary LibreSign fork with the pr-number forwarding fix. # Replace with upstream once the fix is merged and released. uses: LibreSign/pr-preview-action@2a6da1177b47dc23173ba9a75e01da0a0d800978 @@ -74,7 +101,7 @@ jobs: - name: Wait for preview Pages publication - if: github.event.pull_request.head.repo.full_name == github.repository + if: steps.freshness.outputs.is_latest == 'true' && github.event.pull_request.head.repo.full_name == github.repository env: DEPLOYED_SHA: ${{ steps.deploy_preview.outputs.deployed-commit-sha }} GH_TOKEN: ${{ secrets.PREVIEW_TOKEN }} From b054118efb9c5c81549f4417926af2077969401c Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:20:36 -0300 Subject: [PATCH 32/39] ci: cancel superseded preview runs Signed-off-by: Vitor Mattos --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 5a4016a9..add74d19 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -11,7 +11,7 @@ permissions: concurrency: group: site-preview-deploy - cancel-in-progress: false + cancel-in-progress: true queue: max jobs: From 30cf5ea48b501f19f2d5aa90f65d5c6715f6a96b Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:21:39 -0300 Subject: [PATCH 33/39] ci: use standard preview concurrency cancellation Signed-off-by: Vitor Mattos --- .github/workflows/preview.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index add74d19..25a579c0 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -12,7 +12,6 @@ permissions: concurrency: group: site-preview-deploy cancel-in-progress: true - queue: max jobs: preview: From ec78de7732b53e3470d9eaef6c0dc7a1b057edd4 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:29:41 -0300 Subject: [PATCH 34/39] ci: refresh latest PR preview Signed-off-by: Vitor Mattos From 2baf7a4ae66ee4179f1ba021e5d4458b516ff181 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:30:23 -0300 Subject: [PATCH 35/39] ci: move preview deploys off stale concurrency queue Signed-off-by: Vitor Mattos --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 25a579c0..d0e45131 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -10,7 +10,7 @@ permissions: pull-requests: write concurrency: - group: site-preview-deploy + group: site-preview-deploy-v2 cancel-in-progress: true jobs: From 4e082f745de7bb1e604e6f3fbf2d1bc0fde934bf Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:30:27 -0300 Subject: [PATCH 36/39] ci: move preview deploys off stale concurrency queue Signed-off-by: Vitor Mattos --- .github/workflows/preview-fork-deploy.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preview-fork-deploy.yml b/.github/workflows/preview-fork-deploy.yml index 070e963b..1f18c592 100644 --- a/.github/workflows/preview-fork-deploy.yml +++ b/.github/workflows/preview-fork-deploy.yml @@ -11,9 +11,8 @@ permissions: pull-requests: write concurrency: - group: site-preview-deploy - cancel-in-progress: false - queue: max + group: site-preview-deploy-v2 + cancel-in-progress: true jobs: deploy-fork-preview: From 69ae91b7c1814720fdea3a65e25b19c47d474ba4 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:42:46 -0300 Subject: [PATCH 37/39] feat: use recorded LibreSign pronunciation Signed-off-by: Vitor Mattos --- source/_assets/js/brand-pronunciation.mjs | 72 +++----- .../assets/audio/libresign-pronunciation.ogg | Bin 0 -> 8261 bytes source/brand.blade.php | 8 +- tests/js/brand-pronunciation.test.mjs | 166 ++++++------------ 4 files changed, 83 insertions(+), 163 deletions(-) create mode 100644 source/assets/audio/libresign-pronunciation.ogg diff --git a/source/_assets/js/brand-pronunciation.mjs b/source/_assets/js/brand-pronunciation.mjs index 7fe9aa7a..45227672 100644 --- a/source/_assets/js/brand-pronunciation.mjs +++ b/source/_assets/js/brand-pronunciation.mjs @@ -1,79 +1,47 @@ -export function pickVoice(voices, language) { - const prefix = language.toLowerCase().split('-')[0]; - return voices.find((voice) => voice.lang.toLowerCase().startsWith(prefix)); -} - -export function createPronunciationController({ button, status, synth, Utterance }) { - const makeUtterance = (text, language) => { - const utterance = new Utterance(text); - utterance.lang = language; - utterance.rate = 0.9; - - const voice = pickVoice(synth.getVoices(), language); - if (voice) { - utterance.voice = voice; - } - - return utterance; - }; - +export function createPronunciationController({ button, status, audio }) { const reset = () => { button.disabled = false; button.removeAttribute('aria-busy'); }; - const play = () => { - synth.cancel(); + const play = async () => { + audio.currentTime = 0; button.disabled = true; button.setAttribute('aria-busy', 'true'); status.textContent = 'Playing LibreSign pronunciation.'; - const libre = makeUtterance('Libre', 'es'); - const sign = makeUtterance('sign', 'en'); - - libre.addEventListener('end', () => synth.speak(sign), { once: true }); - libre.addEventListener('error', () => { + try { + await audio.play(); + } catch { status.textContent = 'Pronunciation playback is not available on this device.'; reset(); - }, { once: true }); + } + }; - sign.addEventListener('end', () => { - status.textContent = 'Pronunciation playback finished.'; - reset(); - }, { once: true }); - sign.addEventListener('error', () => { - status.textContent = 'Pronunciation playback is not available on this device.'; - reset(); - }, { once: true }); + audio.addEventListener('ended', () => { + status.textContent = 'Pronunciation playback finished.'; + reset(); + }); - synth.speak(libre); - }; + audio.addEventListener('error', () => { + status.textContent = 'Pronunciation playback is not available on this device.'; + reset(); + }); - button.hidden = false; button.addEventListener('click', play); return { play }; } -export function initBrandPronunciation({ documentRef = document, windowRef = window } = {}) { +export function initBrandPronunciation({ documentRef = document } = {}) { const button = documentRef.querySelector('[data-brand-pronunciation]'); const status = documentRef.querySelector('[data-brand-pronunciation-status]'); + const audio = documentRef.querySelector('[data-brand-pronunciation-audio]'); - if ( - !button || - !status || - !('speechSynthesis' in windowRef) || - !('SpeechSynthesisUtterance' in windowRef) - ) { + if (!button || !status || !audio || typeof audio.play !== 'function') { return false; } - createPronunciationController({ - button, - status, - synth: windowRef.speechSynthesis, - Utterance: windowRef.SpeechSynthesisUtterance, - }); - + createPronunciationController({ button, status, audio }); return true; } diff --git a/source/assets/audio/libresign-pronunciation.ogg b/source/assets/audio/libresign-pronunciation.ogg new file mode 100644 index 0000000000000000000000000000000000000000..1ceb4401e4c89064941b7aebd4c13edf0fdca29f GIT binary patch literal 8261 zcmX|`RZyNyu&r@-cjp5V+$FfXySoR67k3X1!6CRq;KSW5xD(ui1$W!|_t|y2YHDOX z-D@u9sz=${S{(uk;{T#BHw@;#<=op35lC!hXAd_SOH&I-NM6XGj{ilJ|HJ=({D(vS z+a*?$#X<`HhijNxyP^C$Q84wi;$~y!VP<3H_>Um{H!Q!JJ6Tw|3jWi~|7mP||3o$l z2U|0ze~JIE@c+3${8#wDOUe5s_p_UMdDu9+__%lnev1l^2#X8z4-WM41A_eg!Xo{G z0>i>xJlq`I{9HUeJbXNCTpX;e0Eqg0qLSvn_D*s>Pl%w4-Gl+ZOrCnLGI;`g1Rs!q z@7KTkNP{60IX0)Jcw6m4rk z@ttE_gTm!@I#VeJO7TEs{b0Ez+4yBR9p~TRD5;9dBvN}T<8u7Zc8aC=xtVXujTTB* zcxrDMC~fE}gRgiI9}$sn6P48sqe3kF>3F#o3*MC7z5%fo=UR<&GU%T3F~V=}9iFxh zybcjuy^5xQ&S3ht@oNN2n3|^!_qjRhVns{lNFchYsd3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z5^iqNDA@u>E8R{sZ#<uVrwx#9BK`Pzo}i+fbu^ z+Zb(e%CH(U!f!h_nR-ferUTvqVcdk%7nE7~TH)xtxMV(aewifPR2h87yOms3H+4Ft z^M6Mrgtc>e050V0{;mSm0nue6~#%5ilzC6;a+x2>G^TDvB(!Sam~^i}A7rj~YZ zCSOAf@T8;-Ql|Y?oc>`7qPdhzy^vaZC&iuM0|s5g5NQAt1ABmp8>ZSuUL|?kSG8pe zy;<%O0{2gqg#ZV77r;-fb9Yj9b*05@2tB@tuVFuD8R`tt`DIztEj!77kcPV+ib^B* zln(xitNE=gUC6f%3%o;{1#n9GnvZK56KKqarN+$5AQh{F@~(YfxKUC#K6V8Xhzn89 zV`avk^=OvRh6#^XKxE%dC-eU~`fK)Leu-rwYD!_t%}}}XA;Agk4qt?6$?&$jP zuoApSoqzW$dLJ>zYJ7cQd<*-%5u~a+AO}hQ-nk@Z|BEz!z9JzWxo0<#4n?DbE242p z*Lf^@n3<@6Q(qqYswTp8V7WW+nCEK-z?xE`hix5I3RZpk$chsBJ5S-&gV<<11;v;6 za5$cR&DZ|o|1*cSbhOOw2oJn9@ySvNwldDx1uUk;k?zW9es_WpPJc{0;n|99-PeLs zN%Q))+oxD?>wo_V1(#qgiXndopg-dvy6*y#Z`<@!4WoOxL6MzK6r+47J~wSn$9lX5 z-4*}}TVsM>C_B8lKY8;q+Mbo9_Q-mnwtV2$^NJNZs_a=*gkKLHCf4vPly3#Lw+x?E zSqk_iITcL}uF*fF+Y&J}WK_WT4}khJhf;PC6f3=B_=`n?8|;vbssf<$nMV@6Fi& literal 0 HcmV?d00001 diff --git a/source/brand.blade.php b/source/brand.blade.php index 48c344f4..e0d067a6 100644 --- a/source/brand.blade.php +++ b/source/brand.blade.php @@ -39,18 +39,22 @@ {{ $page->t('Stress the first syllable. It begins with an ee sound, not “lye”.') }}

    Sign: {{ $page->t('Use the English pronunciation.') }}

    +

    - {{ $page->t('Playback uses speech voices installed in your browser or device, so the voice may vary slightly. The written pronunciation above remains the reference.') }} + {{ $page->t('Recorded human pronunciation of LibreSign. The written pronunciation above remains available as a text reference.') }}

    diff --git a/tests/js/brand-pronunciation.test.mjs b/tests/js/brand-pronunciation.test.mjs index e3ddfddc..43eb7a22 100644 --- a/tests/js/brand-pronunciation.test.mjs +++ b/tests/js/brand-pronunciation.test.mjs @@ -4,42 +4,19 @@ import assert from 'node:assert/strict'; import { createPronunciationController, initBrandPronunciation, - pickVoice, } from '../../source/_assets/js/brand-pronunciation.mjs'; -class FakeUtterance { - constructor(text) { - this.text = text; - this.lang = ''; - this.rate = 1; - this.voice = null; - this.listeners = new Map(); - } - - addEventListener(type, callback) { - this.listeners.set(type, callback); - } - - emit(type) { - const callback = this.listeners.get(type); - if (callback) { - callback(); - } - } -} - function makeButton() { const listeners = new Map(); const attributes = new Map(); return { - hidden: true, disabled: false, addEventListener(type, callback) { listeners.set(type, callback); }, - click() { - listeners.get('click')?.(); + async click() { + return listeners.get('click')?.(); }, setAttribute(name, value) { attributes.set(name, value); @@ -53,81 +30,55 @@ function makeButton() { }; } -test('pickVoice matches the requested language prefix case-insensitively', () => { - const voices = [ - { lang: 'en-US', name: 'English' }, - { lang: 'ES-es', name: 'Spanish' }, - ]; +function makeAudio({ rejectPlay = false } = {}) { + const listeners = new Map(); - assert.equal(pickVoice(voices, 'es-MX'), voices[1]); - assert.equal(pickVoice(voices, 'pt-BR'), undefined); -}); + return { + currentTime: 7, + playCalls: 0, + addEventListener(type, callback) { + listeners.set(type, callback); + }, + async play() { + this.playCalls += 1; + if (rejectPlay) { + throw new Error('playback failed'); + } + }, + emit(type) { + listeners.get(type)?.(); + }, + }; +} -test('controller plays Libre first, then Sign, and restores the button', () => { +test('controller restarts and plays the recorded pronunciation', async () => { const button = makeButton(); const status = { textContent: '' }; - const spoken = []; - let cancelled = 0; - - const synth = { - getVoices: () => [{ lang: 'es-ES' }, { lang: 'en-US' }], - cancel: () => { cancelled += 1; }, - speak: (utterance) => { spoken.push(utterance); }, - }; - - createPronunciationController({ - button, - status, - synth, - Utterance: FakeUtterance, - }); - - assert.equal(button.hidden, false); + const audio = makeAudio(); - button.click(); + const controller = createPronunciationController({ button, status, audio }); + await controller.play(); - assert.equal(cancelled, 1); + assert.equal(audio.currentTime, 0); + assert.equal(audio.playCalls, 1); assert.equal(button.disabled, true); assert.equal(button.getAttribute('aria-busy'), 'true'); assert.equal(status.textContent, 'Playing LibreSign pronunciation.'); - assert.equal(spoken.length, 1); - assert.equal(spoken[0].text, 'Libre'); - assert.equal(spoken[0].lang, 'es'); - assert.equal(spoken[0].rate, 0.9); - spoken[0].emit('end'); - - assert.equal(spoken.length, 2); - assert.equal(spoken[1].text, 'sign'); - assert.equal(spoken[1].lang, 'en'); - - spoken[1].emit('end'); + audio.emit('ended'); assert.equal(status.textContent, 'Pronunciation playback finished.'); assert.equal(button.disabled, false); assert.equal(button.getAttribute('aria-busy'), undefined); }); -test('controller restores the button when playback fails', () => { +test('controller restores the button when recorded audio cannot play', async () => { const button = makeButton(); const status = { textContent: '' }; - const spoken = []; - - const synth = { - getVoices: () => [], - cancel: () => {}, - speak: (utterance) => { spoken.push(utterance); }, - }; - - createPronunciationController({ - button, - status, - synth, - Utterance: FakeUtterance, - }); + const audio = makeAudio({ rejectPlay: true }); - button.click(); - spoken[0].emit('error'); + const controller = createPronunciationController({ button, status, audio }); + await controller.play(); assert.equal( status.textContent, @@ -137,51 +88,48 @@ test('controller restores the button when playback fails', () => { assert.equal(button.getAttribute('aria-busy'), undefined); }); -test('init does not expose the control when speech synthesis is unavailable', () => { +test('controller handles media errors', () => { const button = makeButton(); const status = { textContent: '' }; + const audio = makeAudio(); + + createPronunciationController({ button, status, audio }); + + button.disabled = true; + button.setAttribute('aria-busy', 'true'); + audio.emit('error'); + + assert.equal( + status.textContent, + 'Pronunciation playback is not available on this device.', + ); + assert.equal(button.disabled, false); + assert.equal(button.getAttribute('aria-busy'), undefined); +}); + +test('init returns false when required elements are missing', () => { const documentRef = { - querySelector(selector) { - if (selector === '[data-brand-pronunciation]') return button; - if (selector === '[data-brand-pronunciation-status]') return status; + querySelector() { return null; }, }; - const initialized = initBrandPronunciation({ - documentRef, - windowRef: {}, - }); - - assert.equal(initialized, false); - assert.equal(button.hidden, true); + assert.equal(initBrandPronunciation({ documentRef }), false); }); -test('init exposes the control when speech synthesis is supported', () => { +test('init wires the recorded audio control when all elements exist', () => { const button = makeButton(); const status = { textContent: '' }; + const audio = makeAudio(); + const documentRef = { querySelector(selector) { if (selector === '[data-brand-pronunciation]') return button; if (selector === '[data-brand-pronunciation-status]') return status; + if (selector === '[data-brand-pronunciation-audio]') return audio; return null; }, }; - const windowRef = { - speechSynthesis: { - getVoices: () => [], - cancel: () => {}, - speak: () => {}, - }, - SpeechSynthesisUtterance: FakeUtterance, - }; - - const initialized = initBrandPronunciation({ - documentRef, - windowRef, - }); - - assert.equal(initialized, true); - assert.equal(button.hidden, false); + assert.equal(initBrandPronunciation({ documentRef }), true); }); From 9f74ba44fd19eb50da477a42e9928c3cba162949 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 16:50:38 -0300 Subject: [PATCH 38/39] ci: remove previews when pull requests close Signed-off-by: Vitor Mattos --- .github/workflows/preview-remove.yml | 36 ++++++++++++++++++---------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/preview-remove.yml b/.github/workflows/preview-remove.yml index ed8db297..bb89a5cd 100644 --- a/.github/workflows/preview-remove.yml +++ b/.github/workflows/preview-remove.yml @@ -1,6 +1,9 @@ -name: PR Preview Manual Remove +name: PR Preview Remove on: + pull_request_target: + branches: [ main ] + types: [closed] workflow_dispatch: inputs: pr_number: @@ -12,33 +15,42 @@ permissions: contents: read concurrency: - group: site-preview-deploy - cancel-in-progress: false - queue: max + group: site-preview-deploy-v2 + cancel-in-progress: true jobs: remove-preview: runs-on: ubuntu-latest steps: - - name: Validate PR number input - id: validate + - name: Resolve PR number + id: pr env: + EVENT_NAME: ${{ github.event_name }} + EVENT_PR_NUMBER: ${{ github.event.pull_request.number }} INPUT_PR_NUMBER: ${{ inputs.pr_number }} run: | - if ! [[ "$INPUT_PR_NUMBER" =~ ^[1-9][0-9]*$ ]]; then - echo "Invalid pr_number: must be a positive integer." >&2 + set -euo pipefail + + if [ "$EVENT_NAME" = "pull_request_target" ]; then + pr_number="$EVENT_PR_NUMBER" + else + pr_number="$INPUT_PR_NUMBER" + fi + + if ! [[ "$pr_number" =~ ^[1-9][0-9]*$ ]]; then + echo "Invalid PR number: must be a positive integer." >&2 exit 1 fi - echo "pr_number=$INPUT_PR_NUMBER" >> "$GITHUB_OUTPUT" + echo "number=$pr_number" >> "$GITHUB_OUTPUT" - name: Remove preview snapshot - # Keep this pinned to the same reviewed fork commit used by other - # privileged preview paths for consistent behavior. + # This workflow never checks out or executes pull-request code. + # It only uses the PR number from the trusted base-repository event. uses: LibreSign/pr-preview-action@2a6da1177b47dc23173ba9a75e01da0a0d800978 with: action: remove - pr-number: ${{ steps.validate.outputs.pr_number }} + pr-number: ${{ steps.pr.outputs.number }} deploy-repository: LibreSign/site-preview preview-branch: main pages-base-url: libresign.github.io/site-preview From 41841ea7add075ccdd5061274781910e7fc0fd9f Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Fri, 25 Sep 2026 17:00:12 -0300 Subject: [PATCH 39/39] ci: simplify preview workflows and name Node tests Signed-off-by: Vitor Mattos --- .../{javascript-tests.yml => node-test.yml} | 4 +- .github/workflows/preview-fork-deploy.yml | 102 ++---------------- .github/workflows/preview-remove.yml | 44 +------- .github/workflows/preview.yml | 91 ++-------------- 4 files changed, 26 insertions(+), 215 deletions(-) rename .github/workflows/{javascript-tests.yml => node-test.yml} (86%) diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/node-test.yml similarity index 86% rename from .github/workflows/javascript-tests.yml rename to .github/workflows/node-test.yml index ec8a229a..6c48986f 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/node-test.yml @@ -1,4 +1,4 @@ -name: JavaScript tests +name: Node tests on: pull_request: @@ -22,5 +22,5 @@ jobs: - name: Install dependencies run: npm ci - - name: Run JavaScript tests + - name: Run Node tests run: npm run test:js diff --git a/.github/workflows/preview-fork-deploy.yml b/.github/workflows/preview-fork-deploy.yml index 1f18c592..7e0de3dc 100644 --- a/.github/workflows/preview-fork-deploy.yml +++ b/.github/workflows/preview-fork-deploy.yml @@ -10,59 +10,16 @@ permissions: contents: read pull-requests: write -concurrency: - group: site-preview-deploy-v2 - cancel-in-progress: true - jobs: - deploy-fork-preview: + deploy: if: > - github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.event == 'pull_request' + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.pull_requests[0].head.repo.id != github.event.workflow_run.repository.id runs-on: ubuntu-latest - steps: - - name: Extract PR number from workflow_run payload - id: pr - run: | - pr_number=$(jq -r '.workflow_run.pull_requests[0].number // empty' "$GITHUB_EVENT_PATH") - echo "number=$pr_number" >> "$GITHUB_OUTPUT" - - - name: Evaluate fork and freshness - id: pr_meta - if: steps.pr.outputs.number != '' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - pr_json=$(curl -sS \ - -H "Authorization: Bearer $GH_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/${{ github.repository }}/pulls/${{ steps.pr.outputs.number }}") - - pr_head_sha=$(echo "$pr_json" | jq -r '.head.sha // ""') - pr_head_repo=$(echo "$pr_json" | jq -r '.head.repo.full_name // ""') - - is_fork=false - if [ "$pr_head_repo" != "${{ github.repository }}" ]; then - is_fork=true - fi - is_latest=false - if [ "$pr_head_sha" = "${{ github.event.workflow_run.head_sha }}" ]; then - is_latest=true - fi - - should_deploy=false - if [ "$is_fork" = "true" ] && [ "$is_latest" = "true" ]; then - should_deploy=true - fi - - echo "is_fork=$is_fork" >> "$GITHUB_OUTPUT" - echo "is_latest=$is_latest" >> "$GITHUB_OUTPUT" - echo "should_deploy=$should_deploy" >> "$GITHUB_OUTPUT" - - - name: Download fork build artifact - if: steps.pr.outputs.number != '' && steps.pr_meta.outputs.should_deploy == 'true' + steps: + - name: Download preview artifact uses: actions/download-artifact@v4 with: name: preview-build-fork @@ -70,57 +27,14 @@ jobs: run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Deploy fork preview - id: deploy_preview - if: steps.pr.outputs.number != '' && steps.pr_meta.outputs.should_deploy == 'true' - # Temporary LibreSign fork: forwards explicit `pr-number` to the native - # sticky PR comment in `workflow_run`; replace with upstream after merge/release. + - name: Deploy preview uses: LibreSign/pr-preview-action@2a6da1177b47dc23173ba9a75e01da0a0d800978 with: action: deploy source-dir: ./build_production/ - pr-number: ${{ steps.pr.outputs.number }} + pr-number: ${{ github.event.workflow_run.pull_requests[0].number }} pages-base-url: libresign.github.io/site-preview deploy-repository: LibreSign/site-preview preview-branch: main - wait-for-pages-deployment: false + wait-for-pages-deployment: true token: ${{ secrets.PREVIEW_TOKEN }} - - - - - name: Wait for preview Pages publication - if: steps.pr.outputs.number != '' && steps.pr_meta.outputs.should_deploy == 'true' - env: - DEPLOYED_SHA: ${{ steps.deploy_preview.outputs.deployed-commit-sha }} - GH_TOKEN: ${{ secrets.PREVIEW_TOKEN }} - run: | - set -euo pipefail - - for attempt in $(seq 1 60); do - runs=$(curl -fsSL \ - -H "Authorization: Bearer $GH_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/LibreSign/site-preview/actions/runs?head_sha=$DEPLOYED_SHA&per_page=20") - - status=$(echo "$runs" | jq -r ' - [.workflow_runs[] | select(.name == "pages build and deployment")][0].status // "missing" - ') - conclusion=$(echo "$runs" | jq -r ' - [.workflow_runs[] | select(.name == "pages build and deployment")][0].conclusion // "" - ') - - if [ "$status" = "completed" ]; then - if [ "$conclusion" = "success" ]; then - exit 0 - fi - - echo "Pages deployment finished with conclusion: $conclusion" - exit 1 - fi - - echo "Waiting for Pages deployment of $DEPLOYED_SHA (status: $status, attempt: $attempt/60)" - sleep 10 - done - - echo "Timed out waiting for Pages deployment of $DEPLOYED_SHA" - exit 1 diff --git a/.github/workflows/preview-remove.yml b/.github/workflows/preview-remove.yml index bb89a5cd..3e66f109 100644 --- a/.github/workflows/preview-remove.yml +++ b/.github/workflows/preview-remove.yml @@ -2,58 +2,24 @@ name: PR Preview Remove on: pull_request_target: - branches: [ main ] + branches: [main] types: [closed] - workflow_dispatch: - inputs: - pr_number: - description: "Pull request number to remove preview for" - required: true - type: string permissions: contents: read -concurrency: - group: site-preview-deploy-v2 - cancel-in-progress: true - jobs: - remove-preview: + remove: runs-on: ubuntu-latest - steps: - - name: Resolve PR number - id: pr - env: - EVENT_NAME: ${{ github.event_name }} - EVENT_PR_NUMBER: ${{ github.event.pull_request.number }} - INPUT_PR_NUMBER: ${{ inputs.pr_number }} - run: | - set -euo pipefail - - if [ "$EVENT_NAME" = "pull_request_target" ]; then - pr_number="$EVENT_PR_NUMBER" - else - pr_number="$INPUT_PR_NUMBER" - fi - if ! [[ "$pr_number" =~ ^[1-9][0-9]*$ ]]; then - echo "Invalid PR number: must be a positive integer." >&2 - exit 1 - fi - - echo "number=$pr_number" >> "$GITHUB_OUTPUT" - - - name: Remove preview snapshot - # This workflow never checks out or executes pull-request code. - # It only uses the PR number from the trusted base-repository event. + steps: + - name: Remove preview uses: LibreSign/pr-preview-action@2a6da1177b47dc23173ba9a75e01da0a0d800978 with: action: remove - pr-number: ${{ steps.pr.outputs.number }} + pr-number: ${{ github.event.pull_request.number }} deploy-repository: LibreSign/site-preview preview-branch: main pages-base-url: libresign.github.io/site-preview - wait-for-pages-deployment: false comment: false token: ${{ secrets.PREVIEW_TOKEN }} diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index d0e45131..2d94452b 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -2,91 +2,60 @@ name: PR Preview on: pull_request: - branches: [ main ] + branches: [main] types: [opened, reopened, synchronize] +concurrency: + group: pr-preview-${{ github.event.pull_request.number }} + cancel-in-progress: true + permissions: contents: read pull-requests: write -concurrency: - group: site-preview-deploy-v2 - cancel-in-progress: true - jobs: preview: runs-on: ubuntu-latest + steps: - # Deliberately no `closed` handling: previews are kept as historical snapshots. - uses: actions/checkout@v4 - - name: Check whether this is still the latest PR revision - id: freshness - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} - RUN_HEAD_SHA: ${{ github.event.pull_request.head.sha }} - run: | - set -euo pipefail - - current_head=$(curl -fsSL \ - -H "Authorization: Bearer $GH_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER" \ - | jq -r '.head.sha') - - if [ "$current_head" = "$RUN_HEAD_SHA" ]; then - echo "is_latest=true" >> "$GITHUB_OUTPUT" - else - echo "is_latest=false" >> "$GITHUB_OUTPUT" - echo "Skipping stale preview run for $RUN_HEAD_SHA; current PR head is $current_head" - fi - - name: Set up Node.js - if: steps.freshness.outputs.is_latest == 'true' uses: actions/setup-node@v4 with: node-version: 20 - name: Set up PHP 8.3 - if: steps.freshness.outputs.is_latest == 'true' uses: shivammathur/setup-php@v2 with: php-version: 8.3 - name: Install PHP dependencies - if: steps.freshness.outputs.is_latest == 'true' run: composer install - - name: Adjust preview base URLs and config - if: steps.freshness.outputs.is_latest == 'true' + - name: Adjust preview URLs run: | sed -i "s|libresign.coop|libresign.github.io|g" CNAME sed -i "s|baseUrl' => '/'|baseUrl' => 'https://LibreSign.github.io/site-preview/pr-preview/pr-${{ github.event.pull_request.number }}/'|g" config.php sed -i "s|base: '/assets/build/'|base: 'https://libresign.github.io/site-preview/pr-preview/pr-${{ github.event.pull_request.number }}/assets/build/'|g" vite.config.js - cat config.php|grep "'baseUrl' => " sed -i "/'matomo_container'/d" config.production.php - name: Build production site - if: steps.freshness.outputs.is_latest == 'true' env: WC_CONSUMER_KEY: ${{ secrets.WC_CONSUMER_KEY }} WC_CONSUMER_SECRET: ${{ secrets.WC_CONSUMER_SECRET }} run: composer prod - name: Upload fork preview artifact - if: steps.freshness.outputs.is_latest == 'true' && github.event.pull_request.head.repo.full_name != github.repository + if: github.event.pull_request.head.repo.full_name != github.repository uses: actions/upload-artifact@v4 with: name: preview-build-fork path: build_production/ retention-days: 1 - - name: Deploy internal preview - id: deploy_preview - if: steps.freshness.outputs.is_latest == 'true' && github.event.pull_request.head.repo.full_name == github.repository - # Temporary LibreSign fork with the pr-number forwarding fix. - # Replace with upstream once the fix is merged and released. + - name: Deploy preview + if: github.event.pull_request.head.repo.full_name == github.repository uses: LibreSign/pr-preview-action@2a6da1177b47dc23173ba9a75e01da0a0d800978 with: action: deploy @@ -95,43 +64,5 @@ jobs: pages-base-url: libresign.github.io/site-preview deploy-repository: LibreSign/site-preview preview-branch: main - wait-for-pages-deployment: false + wait-for-pages-deployment: true token: ${{ secrets.PREVIEW_TOKEN }} - - - - name: Wait for preview Pages publication - if: steps.freshness.outputs.is_latest == 'true' && github.event.pull_request.head.repo.full_name == github.repository - env: - DEPLOYED_SHA: ${{ steps.deploy_preview.outputs.deployed-commit-sha }} - GH_TOKEN: ${{ secrets.PREVIEW_TOKEN }} - run: | - set -euo pipefail - - for attempt in $(seq 1 60); do - runs=$(curl -fsSL \ - -H "Authorization: Bearer $GH_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/LibreSign/site-preview/actions/runs?head_sha=$DEPLOYED_SHA&per_page=20") - - status=$(echo "$runs" | jq -r ' - [.workflow_runs[] | select(.name == "pages build and deployment")][0].status // "missing" - ') - conclusion=$(echo "$runs" | jq -r ' - [.workflow_runs[] | select(.name == "pages build and deployment")][0].conclusion // "" - ') - - if [ "$status" = "completed" ]; then - if [ "$conclusion" = "success" ]; then - exit 0 - fi - - echo "Pages deployment finished with conclusion: $conclusion" - exit 1 - fi - - echo "Waiting for Pages deployment of $DEPLOYED_SHA (status: $status, attempt: $attempt/60)" - sleep 10 - done - - echo "Timed out waiting for Pages deployment of $DEPLOYED_SHA" - exit 1