Skip to content

Token-driven Design Tokens and End-to-End Localized Output Tests#277

Merged
leynos merged 11 commits intomainfrom
verify-docs-design-tokens-110afk
Mar 23, 2026
Merged

Token-driven Design Tokens and End-to-End Localized Output Tests#277
leynos merged 11 commits intomainfrom
verify-docs-design-tokens-110afk

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Mar 21, 2026

Summary

  • Token-driven design tokens implemented; end-to-end theming across CLI; Stage D/E coverage activated; robust localized output tests and CLI/locale test harness support added to verify theme-driven rendering across languages and configurations. 3.12.1 is complete; docs and roadmap updated accordingly.

Changes

  • docs/execplans/3-12-1-define-design-tokens.md
    • Status updated to COMPLETE; reflected Stage D/E completion and added notes about end-to-end theming and behavioral coverage.
  • docs/netsuke-design.md
    • Added documentation describing token-driven design tokens rollout and their role in reporter output and theming.
  • docs/roadmap.md
    • 3.12.1: updated subtasks under Visual design validation to reflect completion and end-to-end theme coverage.
  • docs/users-guide.md
    • Updated theme/emoji-prefix discussion to reflect token-driven rendering and explicit ASCII/Unicode behavior.
  • locales/en-US/messages.ftl
    • Introduced semantic.prefix.rendered and refactored semantic prefixes to be token-driven; updated translations and references.
  • locales/es-ES/messages.ftl
    • Parallel updates to semantic prefix rendering for Spanish locale.
  • src/localization/keys.rs
    • Added SEMANTIC_PREFIX_RENDERED key to support token-driven rendering.
  • src/output_prefs.rs
    • Reworked to use a theme-backed design-token model instead of a pure emoji flag.
    • Exposed token-derived accessors for task and timing indentation (task_indent, timing_indent).
    • Replaced emoji/emoji-flag based rendering with theme token glyphs and localizable labels.
    • Added internal render helpers to produce semantic prefixes from resolved theme tokens.
    • Adjusted resolution flow to return a theme-backed OutputPrefs via a new from_theme() constructor.
  • src/status.rs
    • Removed hard-coded TASK_INDENT constant; use prefs.task_indent() for task line indentation.
  • src/status_timing.rs
    • Updated to use OutputPrefs timing indentation from the theme instead of a hard-coded indent.
  • src/theme.rs
    • Expanded design token structures to include Copy semantics for tokens (SymbolTokens, SpacingTokens, DesignTokens, ResolvedTheme).
    • Tokens now travel through the theme resolution, enabling end-to-end theming of prefixes and spacing.
  • tests/bdd/steps/accessibility_preferences.rs
    • Adjusted to use normalized Fluent isolates for comparisons; new assertions reference OutputPrefs token-based rendering.
  • tests/bdd/steps/cli.rs
    • Updated error/message assertions to normalize Fluent isolates; align with token-driven semantic prefixes.
  • tests/cli_tests.rs
    • Added CLI integration test harness.
  • tests/cli_tests/locale.rs
    • Updated to import cli_tests helpers and reflect theme/locale interactions.
  • tests/cli_tests/merge.rs
    • Expanded to verify CLI theme resolution across default, file, environment, and CLI layers; added tests for explicit theme override behavior.
  • tests/cli_tests/parsing.rs
    • Expanded CLI parsing tests to include --theme and verify that theme input is parsed and preserved in CLI state.
  • tests/cli_tests/policy.rs
    • Updated tests to account for token-driven prefix rendering in error strings.
  • tests/features/cli.feature
    • Added scenarios for invalid theme values and localized error messages in Spanish.
  • tests/features/progress_output.feature
    • Added scenarios assessing ASCII/Unicode theming impact on progress and timing prefixes in various modes.
  • Additional changes across the codebase to support token-driven rendering and end-to-end theming.

Rationale

  • These changes implement a token-driven design system so reporter output, prefixes, and indentation derive from a single resolved theme, enabling end-to-end verification of design tokens across the theming stack. Documentation and the roadmap are updated to reflect the new flow, ensuring ASCII/Unicode consistency is validated and represented in both code and docs. Tests and integration harnesses have been extended to cover the new behavior end to end.

Testing

  • This is no longer a docs-only change; it includes substantial code and test updates. Please review updated documentation for accuracy and formatting, and run the full test suite:
    • cargo test
    • cargo test --workspace
    • cargo test -p netsuke --tests
  • Updated/added tests include:
    • unit tests for OutputPrefs token-based rendering
    • unit/integration tests around theme resolution and token propagation
    • BDD-style tests around ASCII/Unicode and explicit theme usage
    • CLI integration tests validating theme propagation across default/file/env/CLI layers

◳ Generated by DevBoxer (https://www.devboxer.com)


ℹ️ Tag @devboxerhub to ask questions and address PR feedback

📎 Task: https://www.devboxer.com/task/2e2059db-2a9d-49e9-9c49-dd836842c289

📎 Task: https://www.devboxer.com/task/cac40015-71f5-4550-abb8-78f9f0aaf89b

- Added markdownlint disables around checklist formatting to avoid list item number duplication warnings in execplan.
- Corrected sequential numbering in execplan steps from '1.' to '2.' for steps after baseline.
- Expanded roadmap tasks for 3.12.1 to include routing reporter prefixes and spacing through theme tokens, and added end-to-end theme coverage and documentation for ASCII/Unicode consistency.

Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Mar 21, 2026

Reviewer's Guide

Implements end-to-end, token-driven theming for CLI output by making OutputPrefs a facade over ResolvedTheme tokens, routing prefixes and spacing through the theme system, updating Fluent bundles and docs for the new theme/emoji behavior, and expanding tests and BDD features to validate theme resolution, ASCII/Unicode consistency, and CLI merge precedence.

Sequence diagram for CLI theme resolution and token-driven prefix rendering

sequenceDiagram
    actor User
    participant Cli as CliMain
    participant Ortho as OrthoConfig
    participant Theme as ThemeResolver
    participant Prefs as OutputPrefs
    participant Reporter
    participant L10n as LocalizationModule
    participant Keys as KeysModule

    User->>Cli: Invoke netsuke with --theme and --no-emoji flags
    Cli->>Ortho: Build OrthoConfig from CLI, env, config file
    Ortho-->>Cli: ThemePreference, no_emoji, OutputMode

    Cli->>Theme: resolve_theme(theme, no_emoji, mode, read_env)
    Theme-->>Cli: ResolvedTheme

    Cli->>Prefs: from_theme(resolved_theme)
    Cli-->>Reporter: Construct reporter with OutputPrefs

    Note over Reporter,Prefs: Later, reporter needs an error prefix
    Reporter->>Prefs: error_prefix()
    Prefs->>Prefs: render_prefix(tokens.symbols.error, SEMANTIC_PREFIX_ERROR)
    Prefs->>L10n: message(Keys.SEMANTIC_PREFIX_ERROR)
    L10n-->>Prefs: LocalizedMessage(label)
    Prefs->>L10n: message(Keys.SEMANTIC_PREFIX_RENDERED)
    L10n-->>Prefs: LocalizedMessage(template)
    Prefs->>L10n: with_arg("symbol", tokens.symbols.error)
    Prefs->>L10n: with_arg("label", label)
    L10n-->>Reporter: LocalizedMessage(rendered_prefix)
    Reporter->>User: Render themed error line with Unicode or ASCII prefix
Loading

Class diagram for token-driven OutputPrefs and theme tokens

classDiagram
    class OutputPrefs {
        - ResolvedTheme resolved_theme
        + from_theme(resolved_theme: ResolvedTheme) OutputPrefs
        + emoji_allowed() bool
        + task_indent() str
        + timing_indent() str
        + error_prefix() LocalizedMessage
        + warning_prefix() LocalizedMessage
        + success_prefix() LocalizedMessage
        + info_prefix() LocalizedMessage
        + timing_prefix() LocalizedMessage
        - render_prefix(symbol: str, label_key: str) LocalizedMessage
    }

    class ResolvedTheme {
        + DesignTokens tokens
    }

    class DesignTokens {
        + ColourTokens colours
        + SymbolTokens symbols
        + SpacingTokens spacing
        + bool emoji_allowed
    }

    class SymbolTokens {
        + str error
        + str warning
        + str success
        + str info
        + str timing
    }

    class SpacingTokens {
        + str task_indent
        + str timing_indent
    }

    class ThemePreference {
    }

    class OutputMode {
    }

    class ThemeResolver {
        + resolve_theme(theme: ThemePreference, no_emoji: bool, mode: OutputMode, read_env: FnStrToOptString) ResolvedTheme
    }

    class FnStrToOptString {
    }

    class LocalizedMessage {
        + to_string() str
        + with_arg(name: str, value: str) LocalizedMessage
    }

    class LocalizationModule {
        + message(key: str) LocalizedMessage
    }

    class KeysModule {
        + SEMANTIC_PREFIX_RENDERED str
        + SEMANTIC_PREFIX_ERROR str
        + SEMANTIC_PREFIX_WARNING str
        + SEMANTIC_PREFIX_SUCCESS str
        + SEMANTIC_PREFIX_INFO str
        + SEMANTIC_PREFIX_TIMING str
    }

    OutputPrefs *-- ResolvedTheme
    ResolvedTheme *-- DesignTokens
    DesignTokens *-- SymbolTokens
    DesignTokens *-- SpacingTokens
    ThemeResolver ..> ResolvedTheme
    ThemeResolver ..> ThemePreference
    ThemeResolver ..> OutputMode
    ThemeResolver ..> FnStrToOptString
    OutputPrefs ..> LocalizationModule
    OutputPrefs ..> KeysModule
    LocalizationModule ..> LocalizedMessage
    KeysModule <.. OutputPrefs
Loading

File-Level Changes

Change Details Files
Make OutputPrefs a facade over resolved design tokens and route all semantic prefixes/spacing through the theme system.
  • Replace OutputPrefs.emoji flag with a stored ResolvedTheme instance plus a from_theme() constructor.
  • Expose emoji_allowed(), task_indent(), and timing_indent() accessors backed by design tokens.
  • Introduce a render_prefix helper that builds prefixes from theme symbol tokens and localized label keys via the new semantic.prefix.rendered Fluent message.
  • Update error_prefix, warning_prefix, success_prefix, info_prefix, and timing_prefix to use theme symbol tokens instead of emoji select logic.
  • Change resolve_from_theme_with and resolve_with to always call theme::resolve_theme and return OutputPrefs::from_theme.
  • Move OutputPrefs tests into a dedicated src/output_prefs_tests.rs module and extend them for token-backed rendering and spacing.
src/output_prefs.rs
src/output_prefs_tests.rs
Extend the theme token model to be cheaply copyable and ensure tokens drive reporter indentation and glyphs.
  • Derive Copy for SymbolTokens, SpacingTokens, DesignTokens, and ResolvedTheme to allow storing themes by value in OutputPrefs.
  • Use OutputPrefs.task_indent() and timing_indent() in status/status_timing rendering instead of the TASK_INDENT constant.
  • Remove TASK_INDENT from status.rs and update status tests to assert indentation via prefs.task_indent().
src/theme.rs
src/status.rs
src/status_timing.rs
src/status_tests.rs
Refactor localization bundles to separate symbol selection from localized labels and support token-driven prefixes.
  • Replace per-prefix emoji-based select expressions in Fluent with a generic semantic.prefix.rendered that formats { $symbol } { $label }.
  • Change semantic.prefix.* messages in English and Spanish to hold only the textual label (e.g., "Error:" / "Advertencia:").
  • Add SEMANTIC_PREFIX_RENDERED to localization keys for use by OutputPrefs::render_prefix.
locales/en-US/messages.ftl
locales/es-ES/messages.ftl
src/localization/keys.rs
Add and extend CLI tests to cover theme parsing, precedence, locale interactions, and error messaging, and normalize Fluent isolates in assertions.
  • Activate the tests/cli_tests module tree via a new tests/cli_tests.rs harness.
  • Refactor merge tests to compose layered configs including theme values and assert theme precedence (CLI > env > config > defaults).
  • Add a dedicated test to validate CLI theme override precedence across CLI, env, and file layers.
  • Update CLI parsing tests to use parse_with_localizer_from, add coverage for --theme ascii
unicode, and assert invalid theme values map to ValueValidation errors.
  • Normalize Fluent isolate markers in BDD step implementations and CLI policy tests before asserting on rendered strings.
  • Adjust network policy tests for updated error variants and messages that now include policy context.
  • Add BDD and feature coverage for theme-related CLI behavior and ASCII/Unicode output consistency.
    • Extend progress_output.feature with scenarios for explicit ASCII/Unicode themes and verbose ASCII timing prefixes.
    • Extend cli.feature with scenarios for invalid --theme values in both English and Spanish, asserting localized validation messages.
    • Update BDD steps to normalize Fluent isolates when checking prefixes and error fragments, ensuring locale/theme combinations are robustly tested.
    tests/features/progress_output.feature
    tests/features/cli.feature
    tests/bdd/steps/accessibility_preferences.rs
    tests/bdd/steps/cli.rs
    Update design documentation, execplan, and roadmap to reflect completion of token-driven theming and its behavioral coverage.
    • Mark execplan 3-12-1 status as COMPLETE, document completed stages D/E, reporter token integration, and the reactivated CLI test harness.
    • Describe the finalized theme resolution and OutputPrefs façade in netsuke-design, emphasizing single-source-of-truth tokens and legacy no_emoji behavior.
    • Revise the user guide to describe the new theme hierarchy (CLI/env/config), precedence between theme and no_emoji/NO_COLOR, and concrete Unicode vs ASCII prefixes.
    • Update the roadmap entry for 3.12.1 as done, with subtasks focused on routing prefixes/spacing through tokens and end-to-end ASCII/Unicode coverage.
    • Tidy execplan command-list markdown formatting for shell examples.
    docs/execplans/3-12-1-define-design-tokens.md
    docs/netsuke-design.md
    docs/users-guide.md
    docs/roadmap.md

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    @coderabbitai
    Copy link
    Copy Markdown
    Contributor

    coderabbitai bot commented Mar 21, 2026

    No actionable comments were generated in the recent review. 🎉

    ℹ️ Recent review info
    ⚙️ Run configuration

    Configuration used: Organization UI

    Review profile: ASSERTIVE

    Plan: Pro

    Run ID: 3f47fed9-a96b-4632-b5f2-2cc497229549

    📥 Commits

    Reviewing files that changed from the base of the PR and between 615cae1 and 84a2988.

    📒 Files selected for processing (1)
    • src/output_prefs.rs

    Summary by CodeRabbit

    • New Features

      • Users can now configure output themes (ASCII, Unicode, Auto) via CLI --theme, environment variable NETSUKE_THEME, or configuration file.
      • Theme preference determines visual prefixes and spacing in command output.
      • Explicit precedence order: CLI flag > environment variable > config file > defaults.
      • Legacy no_emoji setting continues to work as ASCII theme alias.
    • Tests

      • Added theme validation and end-to-end theme coverage scenarios.
    • Documentation

      • Updated user guide and design documentation to reflect configurable theme system.

    Walkthrough

    Summarise centralised theme resolution: make OutputPrefs hold a ResolvedTheme; derive semantic prefixes and indentation from theme symbol/spacing tokens; update CLI parsing for --theme, precedence, locales, docs and tests; reactivate CLI integration tests and add BDD coverage for ASCII/Unicode/invalid themes.

    Changes

    Cohort / File(s) Summary
    Documentation & roadmap
    docs/execplans/3-12-1-define-design-tokens.md, docs/netsuke-design.md, docs/roadmap.md, docs/users-guide.md
    Mark milestone complete; document centralised theme resolution and precedence (CLI > Env > Config > Mode); replace emoji-suppression model with configurable theme selection (--theme auto|unicode|ascii) and legacy no_emoji mapping.
    Localisation
    locales/en-US/messages.ftl, locales/es-ES/messages.ftl
    Remove $emoji-based Fluent selects; replace semantic prefix selects with fixed localized label strings; add semantic.prefix.rendered for combined symbol+label rendering.
    OutputPrefs & theme integration
    src/output_prefs.rs, src/output_prefs_tests.rs, src/theme.rs
    Refactor OutputPrefs to hold ResolvedTheme and add from_theme; prefix accessors now render strings from resolved_theme.tokens.symbols + localized label via render_prefix(); add spacing accessors (task_indent, timing_indent); tests updated; token structs now derive Copy.
    Reporter indentation & timing
    src/status.rs, src/status_timing.rs, src/status_tests.rs, src/status_timing_tests.rs
    Replace hard-coded indent constant(s) with prefs.task_indent() and prefs.timing_indent(); update tests to use test_support::fluent::normalize_fluent_isolates and localizer fixtures.
    CLI integration & parsing
    tests/cli_tests.rs, tests/cli_tests/parsing.rs, tests/cli_tests/merge.rs, tests/cli_tests/locale.rs
    Reactivate CLI integration test harness; add --theme parsing via ThemePreference, validate values, and test merge precedence across defaults/config/env/CLI; adapt test helpers for integration layout.
    BDD & end-to-end tests
    tests/features/cli.feature, tests/features/progress_output.feature, tests/bdd/steps/accessibility_preferences.rs, tests/bdd/steps/cli.rs, tests/cli_tests/policy.rs
    Add --theme parsing and invalid-value scenarios; add progress-output scenarios asserting theme-specific prefix glyphs; normalise Fluent isolates for prefix/error assertions.
    Test harness activation
    tests/cli_tests/mod.rs, tests/cli_tests/*
    Activate CLI test module under cargo tests and adapt module imports to the integration-harness layout.
    Misc tests & localization keys
    src/localization/keys.rs, tests/*
    Add new Fluent key SEMANTIC_PREFIX_RENDERED; update tests to use shared normalization helpers and refactor fixtures/assertions accordingly.

    Sequence Diagram(s)

    sequenceDiagram
        participant User as User
        participant CLI as CLI / Config / Env
        participant Resolver as theme::resolve_theme
        participant Prefs as OutputPrefs
        participant Reporter as Reporter (Status/Timing)
    
        User->>CLI: Provide --theme / env / config / defaults
        CLI->>Resolver: Request resolved theme (apply precedence)
        Resolver->>Resolver: Apply legacy no_emoji rules and mode defaults
        Resolver->>Prefs: Return ResolvedTheme (symbols & spacing tokens)
        Prefs->>Reporter: Construct OutputPrefs.from_theme(...) and provide tokens
        Reporter->>Reporter: Render prefixes from resolved_theme.tokens.symbols + localized labels
        Reporter->>Reporter: Format indentation from prefs.task_indent() / timing_indent()
        Reporter->>User: Emit theme-consistent output (ASCII or Unicode)
    
    Loading

    Estimated code review effort

    🎯 4 (Complex) | ⏱️ ~45 minutes

    Possibly related PRs

    Poem

    🎨 Shift the glyphs, let tokens sing,
    Route themes through prefs and let reporters bring,
    ASCII prance or Unicode gleam,
    Indents align, the tests now beam,
    The milestone lands — design complete and bright. ✨

    🚥 Pre-merge checks | ✅ 3
    ✅ Passed checks (3 passed)
    Check name Status Explanation
    Title check ✅ Passed The title accurately describes the main change: implementing token-driven design tokens and end-to-end localized output tests, which aligns with the substantial code, localization, and test additions across the changeset.
    Description check ✅ Passed The description comprehensively documents the changes across documentation, localization, core code, and tests, explaining the token-driven design-token rollout, theme propagation, and end-to-end testing coverage introduced by this PR.
    Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

    ✏️ Tip: You can configure your own custom pre-merge checks in the settings.

    ✨ Finishing Touches
    📝 Generate docstrings
    • Create stacked PR
    • Commit on current branch
    🧪 Generate unit tests (beta)
    • Create PR with unit tests
    • Commit unit tests in branch verify-docs-design-tokens-110afk

    Comment @coderabbitai help to get the list of available commands and usage tips.

    codescene-delta-analysis[bot]

    This comment was marked as outdated.

    …es and spacing
    
    - Replace emoji-based semantic prefix rendering with theme-backed symbol tokens.
    - OutputPrefs now delegates prefix and spacing decisions to the resolved theme.
    - Reporter modules use theme spacing tokens replacing hard-coded indent literals.
    - Add CLI theme flag and OrthoConfig integration for centralized theme resolution.
    - Add comprehensive unit, integration, and BDD test coverage for themes.
    - Update localization, docs, and roadmap to reflect theme-driven output design.
    
    This completes roadmap item 3.12.1 by making design tokens the single source for glyphs and spacing in CLI output, enabling consistent ASCII/Unicode rendering across the application.
    
    Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
    codescene-delta-analysis[bot]

    This comment was marked as outdated.

    @leynos leynos changed the title Verify design tokens implementation and update roadmap Implement design tokens with end-to-end theming and update roadmap Mar 21, 2026
    @leynos
    Copy link
    Copy Markdown
    Owner Author

    leynos commented Mar 22, 2026

    @coderabbitai Please suggest a fix for this issue and supply a prompt for an AI coding agent to enable it to apply the fix. Include the file and symbol names indicated in the issue at the head of your response.

    tests/cli_tests/merge.rs

    Comment on file

        defaults_object.insert("fetch_allow_scheme".to_owned(), json!(["https"]));
        defaults_object.insert("progress".to_owned(), json!(true));
        defaults_object.insert("diag_json".to_owned(), json!(false));
        defaults_object.insert("theme".to_owned(), json!("auto"));

    ❌ New issue: Large Method
    cli_merge_layers_respects_precedence_and_appends_lists has 70 lines, threshold = 70

    @coderabbitai

    This comment was marked as resolved.

    Refactored the cli merge test by extracting the setup code into a helper function `build_precedence_and_append_composer` and the assertions into `assert_precedence_and_append_invariants`. This improves readability and reuse of the test logic while preserving existing test coverage.
    
    Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
    @leynos leynos changed the title Implement design tokens with end-to-end theming and update roadmap Token-driven design: end-to-end theming and roadmap updates Mar 22, 2026
    codescene-delta-analysis[bot]

    This comment was marked as outdated.

    @leynos leynos marked this pull request as ready for review March 22, 2026 02:27
    Copy link
    Copy Markdown
    Contributor

    @sourcery-ai sourcery-ai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Hey - I've found 2 issues, and left some high level feedback:

    • Several test modules now define their own strip_isolates / normalize_fluent_isolates-style helpers; consider moving these into a shared test utility (e.g. test_support) to avoid duplication and keep Fluent-isolate normalization consistent across tests.
    Prompt for AI Agents
    Please address the comments from this code review:
    
    ## Overall Comments
    - Several test modules now define their own `strip_isolates` / `normalize_fluent_isolates`-style helpers; consider moving these into a shared test utility (e.g. `test_support`) to avoid duplication and keep Fluent-isolate normalization consistent across tests.
    
    ## Individual Comments
    
    ### Comment 1
    <location path="docs/netsuke-design.md" line_range="2088-2089" />
    <code_context>
    
    +Theme resolution for CLI output is centralized in `src/theme.rs`. Netsuke
    +resolves one theme through OrthoConfig layers (`--theme`, `NETSUKE_THEME`,
    +config file, then mode defaults) and hands the resulting symbol and spacing
    +tokens to reporters through the `OutputPrefs` compatibility facade. This keeps
    +reporter code focused on status semantics rather than glyph choice, preserves
    +`no_emoji` as a legacy ASCII-forcing alias when no explicit theme is supplied,
    +and gives later roadmap items a stable snapshot surface for validating ASCII
    +and Unicode renderings without duplicating formatting rules.
    +
     For screen readers: The following flowchart shows how the build script audits
    </code_context>
    <issue_to_address>
    **nitpick (typo):** Spelling of "facade" is inconsistent with earlier uses of "façade" for the same concept.
    
    Here `OutputPrefs` is called a "compatibility facade", while elsewhere (e.g., exec plan docs) the same concept is spelled "façade". Please choose one spelling and use it consistently across the docs.
    
    ```suggestion
    config file, then mode defaults) and hands the resulting symbol and spacing
    tokens to reporters through the `OutputPrefs` compatibility façade. This keeps
    ```
    </issue_to_address>
    
    ### Comment 2
    <location path="docs/netsuke-design.md" line_range="2086" />
    <code_context>
     mode is off and also suppressed on failed runs so failures do not imply a
     successful pipeline completion.
    
    +Theme resolution for CLI output is centralized in `src/theme.rs`. Netsuke
    +resolves one theme through OrthoConfig layers (`--theme`, `NETSUKE_THEME`,
    +config file, then mode defaults) and hands the resulting symbol and spacing
    </code_context>
    <issue_to_address>
    **suggestion (review_instructions):** "centralized" is US spelling; en-GB style here should be "centralised".
    
    Please change "centralized" to "centralised" to align this new text with the required en-GB-oxendic spelling convention.
    
    <details>
    <summary>Review instructions:</summary>
    
    **Path patterns:** `**/*.md`
    
    **Instructions:**
    Use en-GB-oxendic (-ize / -yse / -our) spelling and grammar.
    
    </details>
    </issue_to_address>

    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    Copy link
    Copy Markdown
    Contributor

    @coderabbitai coderabbitai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Actionable comments posted: 4

    Caution

    Some comments are outside the diff and can’t be posted inline due to platform limitations.

    ⚠️ Outside diff range comments (1)
    docs/execplans/3-12-1-define-design-tokens.md (1)

    483-530: ⚠️ Potential issue | 🟡 Minor

    Fix the inconsistent numbered list in "Concrete steps".

    The numbered steps restart from 1 twice (lines 483, 503), creating a broken sequence: 1, 2, 1, 2, 1. Renumber consistently or use sub-list indentation to clarify the hierarchy.

    📝 Proposed fix
     ## Concrete steps
     
     All commands below run from the repository root:
     
     ```sh
     cd /home/user/project
    1. Establish the current baseline and locate the relevant code.

      rg -n "theme|OutputPrefs|no_emoji|accessible|progress" src tests docs
    2. Implement the theme module and CLI/config wiring.

      cargo test --workspace theme -- --nocapture

    -Expected shape after Stage B:

    • Expected shape after Stage B:

      running N tests
      test ...theme... ok
      test ...cli... ok
      

    -1. Refresh BDD-generated scenario code if feature text changes.
    +3. Refresh BDD-generated scenario code if feature text changes.

    ```sh
    touch tests/bdd_tests.rs
    ```
    

    -2. Run the full validation gates with logged output.
    +4. Run the full validation gates with logged output.

    ```sh
    set -o pipefail && make check-fmt 2>&1 | tee /tmp/netsuke-3-12-1-check-fmt.log
    ...
    ```
    

    Expected final signal:

    make check-fmt   # exits 0
    ...
    

    -1. Inspect scope before finalizing.
    +5. Inspect scope before finalizing.

    git status --short
    git diff --stat
    </details>
    
    <details>
    <summary>🤖 Prompt for AI Agents</summary>
    
    

    Verify each finding against the current code and only fix it if needed.

    In @docs/execplans/3-12-1-define-design-tokens.md around lines 483 - 530, The
    ordered list in the "Concrete steps" section is inconsistent (restarts at 1);
    update the sequence so the steps read 1 through 5 and adjust the "Expected shape
    after Stage B:" block to not break the numbering (either indent it as a
    non-numbered block or prefix with spaces), specifically renumber "Refresh
    BDD-generated scenario code if feature text changes" to 3, "Run the full
    validation gates with logged output" to 4, and "Inspect scope before finalizing"
    to 5 while preserving the surrounding shell snippets and headings like
    "Establish the current baseline and locate the relevant code" and "Implement the
    theme module and CLI/config wiring".

    
    </details>
    
    </blockquote></details>
    
    </blockquote></details>
    
    🤖 Prompt for all review comments with AI agents
    Verify each finding against the current code and only fix it if needed.
    
    Inline comments:
    In `@docs/users-guide.md`:
    - Around line 799-801: Add a comma before "so" in the sentence "In all output
    modes, Netsuke uses semantic text prefixes so meaning is never conveyed solely
    by colour." to correctly join the two independent clauses; update the sentence
    to read "In all output modes, Netsuke uses semantic text prefixes, so meaning is
    never conveyed solely by colour." in the documentation (locate the sentence text
    and change it accordingly).
    
    In `@src/status_tests.rs`:
    - Around line 164-165: The assertion message for the indentation check uses a
    hardcoded phrase ("two spaces") but the code uses prefs.task_indent() as the
    source of truth; update the failure string in the assertion that wraps
    line.starts_with(prefs.task_indent()) to refer to the "resolved task token"
    (e.g., change "two spaces" to "the resolved task token") so the message matches
    prefs.task_indent()'s dynamic value in status_tests.rs.
    
    In `@tests/cli_tests/parsing.rs`:
    - Around line 77-86: Add a test case to cover the `--theme auto` option by
    adding another #[case(CliCase { ... })] entry similar to the existing ones:
    provide argv: vec!["netsuke", "--theme", "auto"], and assert theme:
    Some(ThemePreference::Auto) (keeping the rest from CliCase::default()); update
    the test cases in parsing.rs alongside the existing ascii and unicode cases to
    ensure `ThemePreference::Auto` is parsed correctly.
    
    In `@tests/cli_tests/policy.rs`:
    - Around line 10-15: Remove the local strip_isolates function from
    tests/cli_tests/policy.rs and replace its usages with the shared helper
    normalize_fluent_isolates from the test_support crate; import
    normalize_fluent_isolates (the function defined in test_support::fluent or
    test_support::normalize_fluent_isolates) at the top of the file and update all
    calls of strip_isolates(...) to normalize_fluent_isolates(...), ensuring you
    delete the duplicate strip_isolates definition so the file relies on the
    centralized test_support implementation.
    
    ---
    
    Outside diff comments:
    In `@docs/execplans/3-12-1-define-design-tokens.md`:
    - Around line 483-530: The ordered list in the "Concrete steps" section is
    inconsistent (restarts at 1); update the sequence so the steps read 1 through 5
    and adjust the "Expected shape after Stage B:" block to not break the numbering
    (either indent it as a non-numbered block or prefix with spaces), specifically
    renumber "Refresh BDD-generated scenario code if feature text changes" to 3,
    "Run the full validation gates with logged output" to 4, and "Inspect scope
    before finalizing" to 5 while preserving the surrounding shell snippets and
    headings like "Establish the current baseline and locate the relevant code" and
    "Implement the theme module and CLI/config wiring".
    
    🪄 Autofix (Beta)

    Fix all unresolved CodeRabbit comments on this PR:

    • Push a commit to this branch (recommended)
    • Create a new PR with the fixes

    ℹ️ Review info
    ⚙️ Run configuration

    Configuration used: Organization UI

    Review profile: ASSERTIVE

    Plan: Pro

    Run ID: 0699325b-9e32-47cb-865a-3a90e10ed1d3

    📥 Commits

    Reviewing files that changed from the base of the PR and between 7799b5f and d034445.

    📒 Files selected for processing (22)
    • docs/execplans/3-12-1-define-design-tokens.md
    • docs/netsuke-design.md
    • docs/roadmap.md
    • docs/users-guide.md
    • locales/en-US/messages.ftl
    • locales/es-ES/messages.ftl
    • src/localization/keys.rs
    • src/output_prefs.rs
    • src/output_prefs_tests.rs
    • src/status.rs
    • src/status_tests.rs
    • src/status_timing.rs
    • src/theme.rs
    • tests/bdd/steps/accessibility_preferences.rs
    • tests/bdd/steps/cli.rs
    • tests/cli_tests.rs
    • tests/cli_tests/locale.rs
    • tests/cli_tests/merge.rs
    • tests/cli_tests/parsing.rs
    • tests/cli_tests/policy.rs
    • tests/features/cli.feature
    • tests/features/progress_output.feature

    Copy link
    Copy Markdown

    @chatgpt-codex-connector chatgpt-codex-connector bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    💡 Codex Review

    Here are some automated review suggestions for this pull request.

    Reviewed commit: d03444537c

    ℹ️ About Codex in GitHub

    Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

    • Open a pull request for review
    • Mark a draft as ready
    • Comment "@codex review".

    If Codex has suggestions, it will comment; otherwise it will react with 👍.

    Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    …keys
    
    - Introduced a new variant in LocalizedMessage to hold pre-rendered literal text.
    - Disabled argument interpolation when using literal messages to prevent misuse.
    - Updated OutputPrefs to use literal formatted prefixes instead of a localization key.
    - Removed deprecated semantic.prefix.rendered key and related localization entries.
    - Adapted tests to normalize Fluent isolates instead of stripping them, improving test stability.
    - Minor docs updates to correct style and clarify output formatting.
    
    This change improves flexibility for rendering localized messages that do not require Fluent key lookup, simplifying code paths and avoiding unnecessary localization overhead.
    
    Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
    codescene-delta-analysis[bot]

    This comment was marked as outdated.

    @leynos
    Copy link
    Copy Markdown
    Owner Author

    leynos commented Mar 22, 2026

    @coderabbitai review

    @coderabbitai
    Copy link
    Copy Markdown
    Contributor

    coderabbitai bot commented Mar 22, 2026

    ✅ Actions performed

    Review triggered.

    Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

    Copy link
    Copy Markdown
    Contributor

    @coderabbitai coderabbitai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Actionable comments posted: 6

    🤖 Prompt for all review comments with AI agents
    Verify each finding against the current code and only fix it if needed.
    
    Inline comments:
    In `@docs/execplans/3-12-1-define-design-tokens.md`:
    - Line 8: Update the 3.12.1 "Define design tokens" execplan so the status fields
    are consistent with the actual gate results: locate the top "Status: COMPLETE"
    and any blocks that currently state "completion depends on a future full gate
    run" (these appear in the section for 3.12.1 and the follow-up task blocks) and
    either change those pending-block texts to reflect success (mirroring the
    completed status) or revert the top "Status: COMPLETE" to an in-progress state
    until the full gate commands have actually passed; ensure the same phrase/field
    is updated in every occurrence so the execplan, the task blocks that mention
    future gate runs, and any follow-up/result notes are aligned.
    
    In `@docs/netsuke-design.md`:
    - Line 2086: Replace the word "centralised" with the en-GB-oxendict "-ize" form
    "centralized" in the sentence "Theme resolution for CLI output is centralised in
    `src/theme.rs`." Update the text near the phrase referencing `src/theme.rs` so
    the line reads "Theme resolution for CLI output is centralized in
    `src/theme.rs`."
    
    In `@src/localization/mod.rs`:
    - Around line 87-113: The with_arg method currently panics when called on a
    literal LocalizedMessage (created by LocalizedMessage::literal); replace the
    runtime assert! with a typed Result to surface the misuse to callers: change pub
    fn with_arg(...) -> Self to return Result<Self, LocalizedMessageError> (or
    Result<Self, &'static str>), remove the assert!, return Ok(self_with_arg) on
    success and Err(LocalizedMessageError::LiteralDoesNotSupportArgs) when
    self.text.is_some(); update the signature and callers to handle the Result and
    add/update docs for with_arg and LocalizedMessage::literal (alternatively,
    consider introducing separate builder types for LiteralLocalizedMessage vs
    KeyedLocalizedMessage to make this unrepresentable at compile time).
    
    In `@src/output_prefs_tests.rs`:
    - Around line 112-150: The test prefix_rendering_uses_theme_symbols currently
    asserts exact en-US strings but doesn't pin the process-wide localizer; modify
    this rstest to use a shared fixture that calls set_localizer_for_tests("en-US")
    before creating prefs so the locale is fixed for all cases — create an
    #[fixture] (e.g., en_us_localizer) that calls set_localizer_for_tests and
    returns (), add it as a parameter to prefix_rendering_uses_theme_symbols, and
    keep using resolve_from_theme_with to build OutputPrefs/LocalizedMessage; this
    ensures prefix_fn(prefs).to_string() always compares against the expected en-US
    literals.
    - Around line 53-63: Remove the two duplicate tests
    emoji_allowed_returns_true_when_permitted and
    emoji_allowed_returns_false_when_suppressed and fold their cases into the
    existing parameterised rstest for resolve_output_prefs (the test using
    resolve_with). Update the rstest's parameter table in resolve_output_prefs to
    include the two scenarios (default_allows_unicode /
    explicit_no_emoji_forces_ascii) by adding the corresponding input and expected
    emoji_allowed boolean values, then delete the standalone test functions so
    behavior is covered only by the resolve_output_prefs/resolve_with parameterised
    cases.
    
    In `@src/output_prefs.rs`:
    - Around line 67-70: The Rustdoc comments currently state concrete returned
    strings (e.g., "✖ Error:" / "X Error:") without qualifying that these are for
    the default en-US localizer; update the docs for the methods that use
    keys::SEMANTIC_PREFIX_* (the localized prefix renderers) to either explicitly
    say "For the default en-US localizer this returns …" or rewrite to
    locale-neutral wording like "Returns the localized error prefix according to the
    active locale (e.g., en-US yields '✖ Error:' for Unicode, 'X Error:' for
    ASCII)"; apply the same change to the other affected doc comments (the blocks at
    lines 89-92, 101-104, 123-126, 135-138) and mention set_localizer to make it
    clear the output depends on the active locale.
    
    🪄 Autofix (Beta)

    Fix all unresolved CodeRabbit comments on this PR:

    • Push a commit to this branch (recommended)
    • Create a new PR with the fixes

    ℹ️ Review info
    ⚙️ Run configuration

    Configuration used: Organization UI

    Review profile: ASSERTIVE

    Plan: Pro

    Run ID: be4dfe32-2403-4990-bfc7-3a4c5254f7f4

    📥 Commits

    Reviewing files that changed from the base of the PR and between d034445 and 0eb3cbd.

    📒 Files selected for processing (13)
    • build.rs
    • docs/execplans/3-12-1-define-design-tokens.md
    • docs/netsuke-design.md
    • docs/users-guide.md
    • locales/en-US/messages.ftl
    • locales/es-ES/messages.ftl
    • src/localization/mod.rs
    • src/output_prefs.rs
    • src/output_prefs_tests.rs
    • src/status_tests.rs
    • src/status_timing_tests.rs
    • tests/cli_tests/parsing.rs
    • tests/cli_tests/policy.rs

    …turn String in output prefixes
    
    - Removed optionality from LocalizedMessage::key and eliminated text field.
    - Removed literal message creation and disallowed attaching args to literal messages.
    - Updated OutputPrefs prefix methods to return String instead of LocalizedMessage.
    - Updated tests to work with String prefixes and added fixture for en-US localizer.
    - Minor docs and naming cleanups related to localization and prefix rendering.
    
    These changes improve type safety and simplify rendering logic by using String directly for output prefixes and streamlining LocalizedMessage struct.
    
    Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
    @leynos leynos changed the title Token-driven design: end-to-end theming and roadmap updates Token-driven design: end-to-end theming complete and roadmap updates Mar 22, 2026
    codescene-delta-analysis[bot]

    This comment was marked as outdated.

    Copy link
    Copy Markdown
    Contributor

    @coderabbitai coderabbitai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Actionable comments posted: 2

    ♻️ Duplicate comments (1)
    src/output_prefs_tests.rs (1)

    147-155: ⚠️ Potential issue | 🟠 Major

    Keep the locale fixture alive for the full assertion.

    Line 153 drops EnUsLocalizerFixture immediately, so the MutexGuard and
    LocalizerGuard are released before prefix_fn(prefs) runs. Hold the fixture
    in scope until the end of the test or this table becomes locale-flaky again.

    🩹 Proposed fix
     fn prefix_rendering_uses_theme_symbols(
    -    en_us_localizer: EnUsLocalizerFixture,
    +    _en_us_localizer: EnUsLocalizerFixture,
         #[case] theme: Option<ThemePreference>,
         #[case] prefix_fn: fn(OutputPrefs) -> String,
         #[case] expected: &str,
     ) {
    -    let _ = en_us_localizer;
         let prefs = resolve_from_theme_with(theme, None, OutputMode::Standard, |_| None);
         assert_eq!(prefix_fn(prefs), expected);
     }
    🤖 Prompt for AI Agents
    Verify each finding against the current code and only fix it if needed.
    
    In `@src/output_prefs_tests.rs` around lines 147 - 155, The test
    prefix_rendering_uses_theme_symbols currently drops the EnUsLocalizerFixture
    immediately (let _ = en_us_localizer;) so the locale guard is released before
    calling prefix_fn(prefs); keep the fixture alive for the duration of the
    assertion by removing the discard binding and instead bind en_us_localizer to a
    named variable that remains in scope until after assert_eq (e.g., let _localizer
    = en_us_localizer;) so the MutexGuard/LocalizerGuard held by
    EnUsLocalizerFixture is not dropped before calling prefix_fn(prefs).
    
    🤖 Prompt for all review comments with AI agents
    Verify each finding against the current code and only fix it if needed.
    
    Inline comments:
    In `@src/output_prefs_tests.rs`:
    - Around line 58-67: The en_us_localizer fixture currently panics by calling
    localizer_test_lock().expect(...); change the fixture signature from fn
    en_us_localizer() -> EnUsLocalizerFixture to a fallible fn returning
    Result<EnUsLocalizerFixture, _> and propagate the mutex error using the ?
    operator when calling localizer_test_lock(); keep constructing
    EnUsLocalizerFixture the same but return Ok(...). Then update any tests that
    consume the en_us_localizer fixture to return Result<(), E> and accept the
    fixture with a trailing ? (allowing the test to use the fallible fixture via ?),
    ensuring tests propagate the error instead of panicking.
    
    In `@src/output_prefs.rs`:
    - Around line 4-7: Update the module-level Rustdoc at the top of
    src/output_prefs.rs to describe that this module resolves a full theme
    (including the NETSUKE_THEME env var) and exposes localized semantic prefix
    helpers plus spacing tokens such as task_indent() and timing_indent();
    specifically mention NETSUKE_THEME and that preferences are auto-detected from
    NO_COLOR, NETSUKE_NO_EMOJI, and NETSUKE_THEME (or can be forced via config), and
    note the presence of the task_indent() and timing_indent() helpers so cargo doc
    reflects current public behaviour.
    
    ---
    
    Duplicate comments:
    In `@src/output_prefs_tests.rs`:
    - Around line 147-155: The test prefix_rendering_uses_theme_symbols currently
    drops the EnUsLocalizerFixture immediately (let _ = en_us_localizer;) so the
    locale guard is released before calling prefix_fn(prefs); keep the fixture alive
    for the duration of the assertion by removing the discard binding and instead
    bind en_us_localizer to a named variable that remains in scope until after
    assert_eq (e.g., let _localizer = en_us_localizer;) so the
    MutexGuard/LocalizerGuard held by EnUsLocalizerFixture is not dropped before
    calling prefix_fn(prefs).
    
    🪄 Autofix (Beta)

    Fix all unresolved CodeRabbit comments on this PR:

    • Push a commit to this branch (recommended)
    • Create a new PR with the fixes

    ℹ️ Review info
    ⚙️ Run configuration

    Configuration used: Organization UI

    Review profile: ASSERTIVE

    Plan: Pro

    Run ID: b0351536-bf5f-4ea9-af35-768ca124b3fa

    📥 Commits

    Reviewing files that changed from the base of the PR and between 0eb3cbd and 6f5f5db.

    📒 Files selected for processing (4)
    • docs/execplans/3-12-1-define-design-tokens.md
    • docs/netsuke-design.md
    • src/output_prefs.rs
    • src/output_prefs_tests.rs

    - Expanded output preference resolution to support full CLI themes via `NETSUKE_THEME`.
    - Updated module docs to reflect theme and spacing-token helper functionality.
    - Preferences now auto-detected from `NO_COLOR`, `NETSUKE_NO_EMOJI`, and `NETSUKE_THEME`.
    - Added helpers like `task_indent` and `timing_indent` for semantic spacing.
    - Improved output_prefs tests for robust localizer handling with better error management.
    
    Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
    codescene-delta-analysis[bot]

    This comment was marked as outdated.

    Replaced calls like prefs.error_prefix().to_string() with prefs.error_prefix() directly, as the prefixes are already in the correct type. This change simplifies the code and avoids redundant conversions in test and accessibility preference steps.
    
    Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
    codescene-delta-analysis[bot]

    This comment was marked as outdated.

    @leynos
    Copy link
    Copy Markdown
    Owner Author

    leynos commented Mar 22, 2026

    @coderabbitai review

    @coderabbitai
    Copy link
    Copy Markdown
    Contributor

    coderabbitai bot commented Mar 22, 2026

    ✅ Actions performed

    Review triggered.

    Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

    Copy link
    Copy Markdown
    Contributor

    @coderabbitai coderabbitai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Actionable comments posted: 1

    ♻️ Duplicate comments (1)
    src/status_tests.rs (1)

    76-96: ⚠️ Potential issue | 🟠 Major

    Pin the localizer for these literal assertions.

    Install en-US under the shared localizer lock before these tests run. They still bake in English fragments ("Task …" / "Stage …"), so any parallel test that swaps the process-wide localizer can make them fail or pass vacuously. Mirror the en_us_localizer fixture pattern already used in src/output_prefs_tests.rs and inject it into the locale-sensitive cases. As per coding guidelines, "In Rust tests, use rstest fixtures for shared setup".

    Also applies to: 123-145

    🤖 Prompt for AI Agents
    Verify each finding against the current code and only fix it if needed.
    
    In `@src/status_tests.rs` around lines 76 - 96, Both locale-sensitive tests need
    the en-US localizer pinned to avoid cross-test locale flakiness: add the
    existing en_us_localizer rstest fixture (same pattern used in
    src/output_prefs_tests.rs) as an extra parameter to the
    task_progress_update_formats_expected_text case-based test and to
    indicatif_reporter_ignores_task_updates_when_stage6_is_not_running (so they
    receive the shared localizer before running). This ensures calls to
    task_progress_update, IndicatifReporter::report_task_progress
    (force_text_reporter), stage6_message and normalize_fluent_isolates observe the
    en-US localizer during assertions.
    
    🤖 Prompt for all review comments with AI agents
    Verify each finding against the current code and only fix it if needed.
    
    Inline comments:
    In `@src/output_prefs.rs`:
    - Around line 62-64: The render_prefix function currently hardcodes the ordering
    and spacing with format!("{symbol} {label}"), preventing locales from
    controlling punctuation/ordering; replace that by fetching the localized
    template via localization::message(SEMANTIC_PREFIX_RENDERED) and interpolate the
    symbol and label into that template (e.g. replace the "{symbol}" and "{label}"
    placeholders in the returned string). Update render_prefix to use
    SEMANTIC_PREFIX_RENDERED and the localized template so translators control the
    final rendering.
    
    ---
    
    Duplicate comments:
    In `@src/status_tests.rs`:
    - Around line 76-96: Both locale-sensitive tests need the en-US localizer pinned
    to avoid cross-test locale flakiness: add the existing en_us_localizer rstest
    fixture (same pattern used in src/output_prefs_tests.rs) as an extra parameter
    to the task_progress_update_formats_expected_text case-based test and to
    indicatif_reporter_ignores_task_updates_when_stage6_is_not_running (so they
    receive the shared localizer before running). This ensures calls to
    task_progress_update, IndicatifReporter::report_task_progress
    (force_text_reporter), stage6_message and normalize_fluent_isolates observe the
    en-US localizer during assertions.
    
    🪄 Autofix (Beta)

    Fix all unresolved CodeRabbit comments on this PR:

    • Push a commit to this branch (recommended)
    • Create a new PR with the fixes

    ℹ️ Review info
    ⚙️ Run configuration

    Configuration used: Organization UI

    Review profile: ASSERTIVE

    Plan: Pro

    Run ID: bb9e1cc1-9e8e-4b8d-9d2f-c14ea77b262d

    📥 Commits

    Reviewing files that changed from the base of the PR and between 6f5f5db and ad9fc0b.

    📒 Files selected for processing (4)
    • src/output_prefs.rs
    • src/output_prefs_tests.rs
    • src/status_tests.rs
    • tests/bdd/steps/accessibility_preferences.rs

    …ed tests
    
    - Introduce a new localization key `semantic.prefix.rendered` for dynamic prefix rendering using placeholders.
    - Update en-US and es-ES Fluent files to include the new rendered prefix message.
    - Modify `OutputPrefs::render_prefix` to use the new localization key, allowing symbol and label substitution.
    - Extend status tests to support localization setup with fixtures and ensure correct localized output in tests.
    - Add necessary imports and error handling to support localization in tests.
    
    This improves localization flexibility for status prefixes and strengthens test coverage with localized messages.
    
    Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
    codescene-delta-analysis[bot]

    This comment was marked as outdated.

    Copy link
    Copy Markdown
    Contributor

    @coderabbitai coderabbitai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Actionable comments posted: 1

    Caution

    Some comments are outside the diff and can’t be posted inline due to platform limitations.

    ⚠️ Outside diff range comments (1)
    src/status_tests.rs (1)

    150-170: ⚠️ Potential issue | 🟠 Major

    Pin the localizer in every test that asserts localized output.

    Add en_us_localizer to these four tests and return Result<()>. They still read through localization::message(...) or compare against pinned English text without taking the global localizer lock, so they remain order-dependent under parallel execution even though the fixture above already serializes the safe path. Mirror the fixture pattern used at Lines 119-147.

    Also applies to: 175-233

    🤖 Prompt for AI Agents
    Verify each finding against the current code and only fix it if needed.
    
    In `@src/status_tests.rs` around lines 150 - 170, Tests asserting localized output
    (e.g., indicatif_reporter_sets_stage6_bar_message_for_non_text_updates and the
    three others around 175-233) must pin the global localizer to avoid
    order-dependent failures; update each such test signature to accept the
    en_us_localizer fixture and return Result<()> (mirror the pattern used in the
    fixture block around lines 119-147), and ensure any calls to
    localization::message(...) remain valid under the pinned localizer before
    returning Ok(()).
    
    🤖 Prompt for all review comments with AI agents
    Verify each finding against the current code and only fix it if needed.
    
    Outside diff comments:
    In `@src/status_tests.rs`:
    - Around line 150-170: Tests asserting localized output (e.g.,
    indicatif_reporter_sets_stage6_bar_message_for_non_text_updates and the three
    others around 175-233) must pin the global localizer to avoid order-dependent
    failures; update each such test signature to accept the en_us_localizer fixture
    and return Result<()> (mirror the pattern used in the fixture block around lines
    119-147), and ensure any calls to localization::message(...) remain valid under
    the pinned localizer before returning Ok(()).
    

    ℹ️ Review info
    ⚙️ Run configuration

    Configuration used: Organization UI

    Review profile: ASSERTIVE

    Plan: Pro

    Run ID: a5a5242c-e711-4870-9cb2-f976c5f7f088

    📥 Commits

    Reviewing files that changed from the base of the PR and between ad9fc0b and 76f5594.

    📒 Files selected for processing (5)
    • locales/en-US/messages.ftl
    • locales/es-ES/messages.ftl
    • src/localization/keys.rs
    • src/output_prefs.rs
    • src/status_tests.rs

    - Updated test functions in src/status_tests.rs to return Result<()> for better error propagation.
    - Replaced assert! macros with ensure! to provide clearer error messages.
    - Added module-level allow attributes to suppress clippy lints triggered by rstest macro expansions.
    - Improved test robustness by properly handling localizer fixture errors with the ? operator.
    
    Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
    @leynos leynos changed the title Token-driven design: end-to-end theming complete and roadmap updates Verify and Fix Localized Output Tests Mar 23, 2026
    codescene-delta-analysis[bot]

    This comment was marked as outdated.

    Copy link
    Copy Markdown
    Contributor

    @coderabbitai coderabbitai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Actionable comments posted: 2

    🤖 Prompt for all review comments with AI agents
    Verify each finding against the current code and only fix it if needed.
    
    Inline comments:
    In `@src/status_tests.rs`:
    - Around line 46-72: The custom EnUsLocalizerFixtureError and its impls are
    unnecessary; change the en_us_localizer fixture to return
    anyhow::Result<EnUsLocalizerFixture>, remove the EnUsLocalizerFixtureError type
    and its impls, and convert the localizer_test_lock() error into an anyhow error
    (e.g., via .map_err(anyhow::anyhow!(...)) or .context(...)); keep the rest of
    en_us_localizer (Arc::from(cli_localization::build_localizer(...)) and
    localization::set_localizer_for_tests(...)) unchanged.
    - Around line 3-11: Add a FIXME comment above the module-level allow block
    explaining this is a last-resort suppression and reference a tracking issue
    (e.g., upstream rstest fix or refactor issue) so it can be removed later; keep
    the explanatory sentence about rstest macro expansion but insert a FIXME URL
    like "https://github.com/your-org/issue-number" and remove the unnecessary
    clippy allows that silence the detector (drop clippy::allow_attributes and
    clippy::allow_attributes_without_reason) leaving only clippy::too_many_arguments
    if absolutely required so the module attribute reads clearly and is traceable.
    
    🪄 Autofix (Beta)

    Fix all unresolved CodeRabbit comments on this PR:

    • Push a commit to this branch (recommended)
    • Create a new PR with the fixes

    ℹ️ Review info
    ⚙️ Run configuration

    Configuration used: Organization UI

    Review profile: ASSERTIVE

    Plan: Pro

    Run ID: 17ce76c5-70ca-4c95-84e3-88447294ff0e

    📥 Commits

    Reviewing files that changed from the base of the PR and between 76f5594 and eec0e9b.

    📒 Files selected for processing (1)
    • src/status_tests.rs

    …tatus_tests
    
    - Removed EnUsLocalizerFixtureError type and its impls.
    - Changed en_us_localizer fixture to return anyhow::Result directly.
    - Updated relevant test cases to use simplified error type.
    - Added module-level allow and FIXME comments for clippy::too_many_arguments lint from rstest macro expansions.
    
    Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
    @leynos leynos changed the title Verify and Fix Localized Output Tests Token-driven Design Tokens and End-to-End Localized Output Tests Mar 23, 2026
    codescene-delta-analysis[bot]

    This comment was marked as outdated.

    Copy link
    Copy Markdown
    Contributor

    @coderabbitai coderabbitai bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Actionable comments posted: 1

    🤖 Prompt for all review comments with AI agents
    Verify each finding against the current code and only fix it if needed.
    
    Inline comments:
    In `@src/status_tests.rs`:
    - Around line 3-14: Create a real tracking issue and replace the "TBD"
    placeholder in the module-level FIXME comment that precedes the #[allow(...)]
    (the comment referencing rstest macro and the module-level
    clippy::too_many_arguments allow) with the actual GitHub issue number (e.g.,
    change "https://github.com/leynos/netsuke/issues/TBD" to
    "https://github.com/leynos/netsuke/issues/<your-issue-number>") so the FIXME has
    a concrete link; ensure the comment still begins with "FIXME:" and that the URL
    points to the newly created issue that tracks removal of the suppression.
    
    🪄 Autofix (Beta)

    Fix all unresolved CodeRabbit comments on this PR:

    • Push a commit to this branch (recommended)
    • Create a new PR with the fixes

    ℹ️ Review info
    ⚙️ Run configuration

    Configuration used: Organization UI

    Review profile: ASSERTIVE

    Plan: Pro

    Run ID: 05f2102e-286d-44b0-abc9-f81f4e4f4278

    📥 Commits

    Reviewing files that changed from the base of the PR and between eec0e9b and 615cae1.

    📒 Files selected for processing (1)
    • src/status_tests.rs

    …mples
    
    The documentation examples for resolve_with, error_prefix, and success_prefix were updated to remove redundant .to_string() method calls, improving clarity and correctness in code samples.
    
    Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
    @leynos
    Copy link
    Copy Markdown
    Owner Author

    leynos commented Mar 23, 2026

    @coderabbitai review

    @coderabbitai
    Copy link
    Copy Markdown
    Contributor

    coderabbitai bot commented Mar 23, 2026

    ✅ Actions performed

    Review triggered.

    Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

    @leynos leynos merged commit 1b431c6 into main Mar 23, 2026
    16 checks passed
    @leynos leynos deleted the verify-docs-design-tokens-110afk branch March 23, 2026 13:08
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant