Skip to content

Fix native path assertion in font embedding test - #267

Merged
dylanmtaylor merged 1 commit into
storytold:mainfrom
fluorine:fix/fonts-build-ui-paths
Nov 3, 2026
Merged

dylanmtaylor merged 1 commit into
storytold:mainfrom
fluorine:fix/fonts-build-ui-paths

Conversation

@fluorine

@fluorine fluorine commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The interface-font fixture compares a POSIX path fragment against generated Rust containing escaped native separators. On Windows the embedding is correct but the test fails.

Match the selected file's complete canonical include_bytes! expression. This strengthens the existing assertion across platforms and changes no production behavior. Reproduced the failure on unmodified upstream 2eca9b3, then verified the corrected test passes.

Validation on Windows: workspace formatting, strict Clippy and tests; craft-ui Clippy/tests with all features; craft-ui WASM check with all features.

Integration guide.

Summary by CodeRabbit

  • Tests
    • Improved a document-embedding test to verify that generated font references use the selected font’s full canonical path.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7895f5e and 8dbbb90.

Files selected for processing: 1
  • crates/fonts-build/src/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The document-embedding test now checks that the generated include_bytes! expression contains the selected font’s canonicalized full path.

Changes: Font embedding test

Layer / File(s) Summary
Canonical font path assertion
crates/fonts-build/src/tests.rs
The test checks the complete include_bytes! expression using the selected font’s canonicalized path.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: aiongg

Merge Risk: Minimal · up to 8dbbb

No production behavior changes or actionable merge-blocking risks remain.

Architecture risk: Low · up to 8dbbb

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/fonts-build/src/tests.rs: The test replaces a relative-path substring check with a check for the complete include_bytes! expression using the selected font’s canonicalized path.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: fixing the native-path assertion in the font embedding test.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ReviewerA — source-read COMMENT (not an approval)

I read the diff: a font-embedding test in fonts-build asserted r.table.contains("fonts/1.ttf"), which fails on Windows where the generated Rust escapes native separators and uses the canonical path prefix; it now builds the expected text from the canonical path, include_bytes!({interface_face:?}), which uses the Debug formatting of the path (the same escaping the generator uses). Matching the generator's own output form on every platform is the right fix instead of loosening the assertion. The two things to check are that canonicalize() on Windows returns the \\?\ prefixed path and the generator is given the same canonical path (the comment says it escapes "Windows' canonical path prefix"), and that Debug formatting of a PathBuf and the generator's escaping agree for a non-ASCII temp directory name. I have not run it (Windows is the failing platform), and no exact-head CI result exists for this head; craft-libs has no fork CI, so this is a source-read comment and not an approval. Nothing was run.

I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.

Status: waiting_author.

@dylanmtaylor
dylanmtaylor merged commit 9a20fdb into storytold:main Nov 3, 2026
1 check passed
FredApps pushed a commit that referenced this pull request Nov 11, 2026
Group related dialog and inspector settings in reusable frames with optional accessible headings.

Makes the reusable part of [WordCraft #4038](storytold/wordcraft#4038) available to other Craft apps. Includes API documentation, integration guidance and regression coverage. Consumer adoption remains separate; applications retain their themes, localization and command adapters.

Validation on Windows: workspace formatting, strict Clippy and tests; craft-ui Clippy/tests with all features; craft-ui WASM check with all features. Upstream CI results are tracked on this PR.

Includes the shared test-portability prerequisite [#267](#267); the feature itself is independent of the other UI proposals.

[Integration guide](https://github.com/fluorine/craft-libs/blob/fad5c05170d43f9bdf86c6063131e28669fcb176/crates/ui/README.md).

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
  * Added customizable sections for grouping content vertically, with optional headings and configurable spacing.
  * Sections can fill the available width or use a caller-defined width, and return the result of their content callback.
* **Documentation**
  * Added usage guidance and an example for styling sections in dialogs and inspector panels.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Bluetwinklez pushed a commit to Bluetwinklez/craft-libs that referenced this pull request Dec 3, 2026
Fix native path assertion in font embedding test
Bluetwinklez pushed a commit to Bluetwinklez/craft-libs that referenced this pull request Dec 3, 2026
Group related dialog and inspector settings in reusable frames with optional accessible headings.

Makes the reusable part of [WordCraft storytold#4038](storytold/wordcraft#4038) available to other Craft apps. Includes API documentation, integration guidance and regression coverage. Consumer adoption remains separate; applications retain their themes, localization and command adapters.

Validation on Windows: workspace formatting, strict Clippy and tests; craft-ui Clippy/tests with all features; craft-ui WASM check with all features. Upstream CI results are tracked on this PR.

Includes the shared test-portability prerequisite [storytold#267](storytold#267); the feature itself is independent of the other UI proposals.

[Integration guide](https://github.com/fluorine/craft-libs/blob/fad5c05170d43f9bdf86c6063131e28669fcb176/crates/ui/README.md).

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
  * Added customizable sections for grouping content vertically, with optional headings and configurable spacing.
  * Sections can fill the available width or use a caller-defined width, and return the result of their content callback.
* **Documentation**
  * Added usage guidance and an example for styling sections in dialogs and inspector panels.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

3 participants