Skip to content

site: a page for every preset, made from the registry, in both languages - #149

Merged
donislawdev merged 1 commit into
mainfrom
site/preset-pages
Sep 29, 2026
Merged

donislawdev merged 1 commit into
mainfrom
site/preset-pages

Conversation

@donislawdev

@donislawdev donislawdev commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

What changes

  • /presets/ and /pl/presety/ list the presets. Each preset has its own page in both languages: the question it answers, what it usually catches, what the set holds at its defaults, how many files the system under test should accept, reject or decide on (unspecified), every setting with what it takes and its default, and the commands to run it (preset show, generate --preset, preset eject, extends: preset:<id>).
  • The home page gets a presets section, the documentation links to the pages, and Presets is in the header.
  • A text setting is described by its shape (for example "sizes separated by commas") rather than the word "text", on the formats page as well.

Where the numbers come from

Nothing on a preset page is typed. Settings come from the registry, the budget from tfg preset show --json, the reactions from a dry run of the set, both asked in process by the guard. The pages are made from the registry after the language text is filled in, so a new preset gets its pages without anybody adding them, and without its Polish words the render stops and names it.

Guards

  • TestEveryPresetIsDescribedInEveryLanguage - the English question, title, catches and setting descriptions are the registry's own words (the questions had been copies nothing compared), the Polish page carries as many catches and the same settings.
  • TestEveryReactionHasItsMeaningInEveryLanguage - every outcome a manifest can declare has its meaning in every language.
  • TestTheSitemapNeedsNoSchemaButItsOwn counts the rendered pages rather than the ones the language files list, and asserts it reached the made pages.
  • TestEveryLanguageDescribesEverythingTheProgramCanProduce asks for the words of every format setting's shape.
  • 15 mutation entries added for these.

How to see it

TFG_WRITE_SITE=1 go test -tags "$(cat .github/build-tags)" ./internal/guard/ -run TestTheSiteSaysWhatTheToolSays

then open web/public/presets/size-boundaries/index.html through a local server. Measured: 26 addresses in the sitemap, titles 50-59 characters, descriptions 149-164, no page scrolls sideways at 375 px, every command on the new pages runs.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a presets overview and dedicated pages in English and Polish, with descriptions, expected outcomes, settings, default budgets, and commands to inspect or use each preset.
    • Preset pages identify settings that require values from you and link to editable recipe examples.
    • Added preset links to the homepages and updated documentation to explain presets and their relationship to recipes.
  • Improvements

    • Updated navigation and breadcrumbs to show where preset pages sit within the site.

/presets/ and /pl/presety/ list the six presets, and each preset gets a
page of its own: the question, what it usually catches, what the set holds
at its defaults (files, targets, bytes, formats), how many files the
system under test should accept, reject or decide on, every setting with
what it takes and its default, and the commands to run it. The home page
and the documentation link to them, and Presets is in the header.

Nothing on those pages is typed. The settings come from the registry, the
budget from tfg preset show and the reactions from a dry run of the set,
asked in process by the guard. The pages themselves are made from the
registry after the language text is filled in, so a seventh preset gets
its pages without anybody adding them, and without its Polish words the
render stops and names it.

The English words of a preset are copies of the registry and are now held
to it - the questions had been copies with nothing comparing them. The
Polish page has to carry as many catches as the English one, because a
page one sentence short renders without complaint.

A text setting is described by its shape rather than the word "text", on
the formats page as well, where two archive settings said nothing about
the value they want.

The sitemap guard counts the pages that were rendered rather than the
ones the language files list, and asserts it reached the made pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Advanced

Run ID: aacd1999-2a40-40a3-bd1c-ce86a755835a

📥 Commits

Reviewing files that changed from the base of the PR and between a72c050 and 2a14ce0.

⛔ Files ignored due to path filters (29)
  • web/public/404.html is excluded by !**/web/public/**
  • web/public/assets/site.css is excluded by !**/web/public/**
  • web/public/create-file-exact-size/index.html is excluded by !**/web/public/**
  • web/public/docs/index.html is excluded by !**/web/public/**
  • web/public/faq/index.html is excluded by !**/web/public/**
  • web/public/formats/index.html is excluded by !**/web/public/**
  • web/public/index.html is excluded by !**/web/public/**
  • web/public/pl/dokumentacja/index.html is excluded by !**/web/public/**
  • web/public/pl/faq/index.html is excluded by !**/web/public/**
  • web/public/pl/formaty/index.html is excluded by !**/web/public/**
  • web/public/pl/index.html is excluded by !**/web/public/**
  • web/public/pl/plik-o-zadanym-rozmiarze/index.html is excluded by !**/web/public/**
  • web/public/pl/presety/empty-and-minimal/index.html is excluded by !**/web/public/**
  • web/public/pl/presety/filename-handling/index.html is excluded by !**/web/public/**
  • web/public/pl/presety/index.html is excluded by !**/web/public/**
  • web/public/pl/presety/size-boundaries/index.html is excluded by !**/web/public/**
  • web/public/pl/presety/tabular-import/index.html is excluded by !**/web/public/**
  • web/public/pl/presety/text-encoding/index.html is excluded by !**/web/public/**
  • web/public/pl/presety/upload-validation/index.html is excluded by !**/web/public/**
  • web/public/pl/zastosowania/index.html is excluded by !**/web/public/**
  • web/public/presets/empty-and-minimal/index.html is excluded by !**/web/public/**
  • web/public/presets/filename-handling/index.html is excluded by !**/web/public/**
  • web/public/presets/index.html is excluded by !**/web/public/**
  • web/public/presets/size-boundaries/index.html is excluded by !**/web/public/**
  • web/public/presets/tabular-import/index.html is excluded by !**/web/public/**
  • web/public/presets/text-encoding/index.html is excluded by !**/web/public/**
  • web/public/presets/upload-validation/index.html is excluded by !**/web/public/**
  • web/public/sitemap.xml is excluded by !**/web/public/**
  • web/public/use-cases/index.html is excluded by !**/web/public/**
📒 Files selected for processing (20)
  • internal/guard/site_test.go
  • internal/guard/sitepresets_test.go
  • internal/site/presets.go
  • internal/site/render.go
  • internal/site/site.go
  • internal/site/view.go
  • web/assets/site.css
  • web/content/en/docs.html
  • web/content/en/index.html
  • web/content/en/preset.html
  • web/content/en/presets.html
  • web/content/en/site.json
  • web/content/pl/docs.html
  • web/content/pl/index.html
  • web/content/pl/preset.html
  • web/content/pl/presets.html
  • web/content/pl/site.json
  • web/templates/layout.html
  • web/templates/partials.html
  • web/templates/social.html

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

📜 Recent review details
⏰ Context from checks skipped due to timeout. (16)
  • GitHub Check: linters
  • GitHub Check: the Chocolatey packages install and leave
  • GitHub Check: coverage gate
  • GitHub Check: test on macos-latest
  • GitHub Check: staticcheck
  • GitHub Check: test on windows-latest
  • GitHub Check: reference tools actually installed
  • GitHub Check: test on ubuntu-latest
  • GitHub Check: semgrep
  • GitHub Check: the installer installs and leaves
  • GitHub Check: import table of the window binary
  • GitHub Check: bill of materials
  • GitHub Check: known vulnerabilities
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (11)
Applies to text shown to the user (labels, buttons, tooltips, placeholders, dialogs, errors, status messages, empty states, translations).

⚙️ CodeRabbit configuration file

Files:

  • internal/guard/site_test.go
  • internal/site/render.go
  • internal/site/view.go
  • internal/site/site.go
  • internal/guard/sitepresets_test.go
  • internal/site/presets.go
Verify tests check real behavior and would fail if the implementation were broken.

⚙️ CodeRabbit configuration file

Files:

  • internal/guard/site_test.go
  • internal/guard/sitepresets_test.go
These are end-user desktop applications.

⚙️ CodeRabbit configuration file

Files:

  • internal/guard/site_test.go
  • internal/site/render.go
  • internal/site/view.go
  • internal/site/site.go
  • internal/guard/sitepresets_test.go
  • internal/site/presets.go
Performance is a known weak spot of these projects.

⚙️ CodeRabbit configuration file

Files:

  • internal/guard/site_test.go
  • internal/site/render.go
  • internal/site/view.go
  • internal/site/site.go
  • internal/guard/sitepresets_test.go
  • internal/site/presets.go
Applies only to code that builds or styles a GUI.

⚙️ CodeRabbit configuration file

Files:

  • internal/guard/site_test.go
  • internal/site/render.go
  • internal/site/view.go
  • internal/site/site.go
  • internal/guard/sitepresets_test.go
  • internal/site/presets.go
Domain: test file generator (Go; `tfg` CLI and `tfg-gui` Fyne window over one engine).

⚙️ CodeRabbit configuration file

Files:

  • internal/guard/site_test.go
  • internal/site/render.go
  • internal/site/view.go
  • internal/site/site.go
  • internal/guard/sitepresets_test.go
  • internal/site/presets.go
SECURITY, HIGH PRIORITY.

⚙️ CodeRabbit configuration file

Files:

  • internal/guard/site_test.go
  • internal/site/render.go
  • internal/site/view.go
  • internal/site/site.go
  • internal/guard/sitepresets_test.go
  • internal/site/presets.go
These apps are QA/developer tools.

⚙️ CodeRabbit configuration file

Files:

  • internal/guard/site_test.go
  • internal/site/render.go
  • internal/site/view.go
  • internal/site/site.go
  • internal/guard/sitepresets_test.go
  • internal/site/presets.go
Source of the public project website (generated output is excluded from review).

⚙️ CodeRabbit configuration file

Files:

  • web/content/en/index.html
  • web/assets/site.css
  • web/content/pl/docs.html
  • web/content/en/docs.html
  • web/templates/layout.html
  • web/templates/social.html
  • web/content/pl/presets.html
  • web/content/pl/index.html
  • web/content/en/preset.html
  • web/templates/partials.html
  • web/content/en/presets.html
  • web/content/pl/preset.html
  • web/content/en/site.json
  • web/content/pl/site.json
  • internal/site/render.go
  • internal/site/view.go
  • internal/site/site.go
  • internal/site/presets.go
Go code.

⚙️ CodeRabbit configuration file

Files:

  • internal/guard/site_test.go
  • internal/site/render.go
  • internal/site/view.go
  • internal/site/site.go
  • internal/guard/sitepresets_test.go
  • internal/site/presets.go
All code in this repository is written by an AI coding agent (Claude Code).

⚙️ CodeRabbit configuration file

Files:

  • web/content/en/index.html
  • web/assets/site.css
  • web/content/pl/docs.html
  • web/content/en/docs.html
  • web/templates/layout.html
  • web/templates/social.html
  • web/content/pl/presets.html
  • web/content/pl/index.html
  • web/content/en/preset.html
  • web/templates/partials.html
  • web/content/en/presets.html
  • web/content/pl/preset.html
  • internal/guard/site_test.go
  • web/content/en/site.json
  • web/content/pl/site.json
  • internal/site/render.go
  • internal/site/view.go
  • internal/site/site.go
  • internal/guard/sitepresets_test.go
  • internal/site/presets.go
🪛 HTMLHint (1.9.2)
web/templates/layout.html

[error] 54-54: Special characters must be escaped : [ < ].

(spec-char-escape)


[error] 54-54: Special characters must be escaped : [ > ].

(spec-char-escape)


[error] 54-54: Tag must be paired, no start tag: [ ]

(tag-pair)

web/templates/social.html

[error] 233-233: Special characters must be escaped : [ < ].

(spec-char-escape)


[error] 233-233: Special characters must be escaped : [ > ].

(spec-char-escape)


[error] 233-233: Tag must be paired, no start tag: [ ]

(tag-pair)

web/content/pl/presets.html

[error] 1-1: Doctype must be declared before any non-comment content.

(doctype-first)

web/content/en/preset.html

[error] 1-1: Doctype must be declared before any non-comment content.

(doctype-first)

web/content/en/presets.html

[error] 1-1: Doctype must be declared before any non-comment content.

(doctype-first)

web/content/pl/preset.html

[error] 1-1: Doctype must be declared before any non-comment content.

(doctype-first)


📝 Walkthrough

Walkthrough

The site adds localized preset overview and detail pages. It populates them with registered preset settings, budgets, and outcomes, and updates navigation and language checks.

Changes

Preset site pages

Layer / File(s) Summary
Preset facts and language data
internal/site/site.go, internal/site/presets.go, internal/guard/site_test.go, internal/guard/sitepresets_test.go, web/content/{en,pl}/site.json
Preset data and translations now include structured titles, descriptions, settings, shapes, and outcomes. Guard tests collect registry and CLI facts and check preset coverage and translated terms.
Preset page generation and navigation
internal/site/..., internal/guard/site_test.go, web/templates/layout.html, web/templates/partials.html, web/templates/social.html, web/assets/site.css
The site generates localized preset pages and builds navigation, parent links, breadcrumbs, and preset cards from page data. The sitemap test counts rendered pages.
Preset page content
web/content/{en,pl}/docs.html, web/content/{en,pl}/index.html, web/content/{en,pl}/preset.html, web/content/{en,pl}/presets.html
The English and Polish content adds preset overview and detail pages, preset links, descriptions, settings, outcomes, and CLI examples.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~30 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant SiteFacts
  participant LanguageConfig
  participant filledLanguages
  participant withPresetPages
  participant viewFor
  participant presetTemplate
  SiteFacts->>filledLanguages: provide registered preset facts
  LanguageConfig->>filledLanguages: provide localized preset text
  filledLanguages->>withPresetPages: add localized preset pages
  withPresetPages-->>filledLanguages: return expanded languages
  filledLanguages->>viewFor: provide page data
  viewFor->>presetTemplate: render preset page view
Loading

Suggested labels: enhancement

Merge Risk: ⚪ Minimal · up to 2a14c

The preset pages have no established issue requiring a fix before merge; normal checks remain appropriate.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 2a14c

The new pages have identifiable validation and rendering controls, and this review found no demonstrated new security exposure. Publication behavior remains insufficiently established to rate the design risk minimal.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The added exposure is generated public site content and links for each preset, not an identified new privileged runtime entrypoint.

Trust Boundaries and Controls

  • observed — Registry-derived IDs are validated before path construction, and preset values displayed in the new pages pass through HTML template rendering rather than becoming executable commands.

Resilience and Maintainability Implications

  • observed — A failed render does not return partially assembled pages to its caller. The separately observed, optional file-rewrite path is not atomic, and production publication semantics remain unverified.
🚥 Pre-merge checks | ✅ 12 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Clear User-Facing Text ⚠️ Warning The Polish preset page names the same concept inconsistently. The title uses “Walidacja uploadu”, while the lead and description use “formularz przesyłania”. The presets page and metadata also mix “up… Choose one Polish term and use it consistently in the preset title, page title, descriptions, card text, and related metadata. For example, replace the prose uses of “upload” with “przesyłanie” or “przesyłania”; keep the stable CLI identifi…
Scope, Duplication And Docs ⚠️ Warning The PR introduces a duplicate byte-grouping helper. internal/site/presets.go:294 adds grouped, which formats an int64 with spaces every three digits. The base revision already provides the equiv… Remove internal/site.grouped and use core.Exactly(facts.Budget.Bytes) for the preset-page byte value. Import internal/core, or move the shared formatter to an appropriate common package if the site layer must remain dependency-free. K…
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main user-facing change: registry-generated pages for every preset in both languages. It is specific and within the length limit.
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.
Tests For Changed Behavior ✅ Passed PASS: The pull request changes the static site renderer and site content, which is UI behavior, not non-UI runtime behavior. It also adds coverage for the changed renderer behavior: preset language co…
No Secrets Or Debug Leftovers ✅ Passed No prohibited agent or environment files were added. Added content contains no credentials, private URLs, local absolute paths, IP addresses, personal emails, or debug calls. The password matches are …
No Hardcoded Ui Styling ✅ Passed The PR does not touch XAML, Slint, Fyne, Tkinter, or WPF code. Its UI-related changes are HTML templates and CSS for the web site, which this check excludes.
No Obvious Performance Problems ✅ Passed No clear performance problem is established. The PR adds a small registry-driven static-site render and caches the preset fact collection once per test binary. The per-preset CLI queries run only in g…
Desktop Robustness ✅ Passed PASS. The PR changes site rendering, localization data, generated HTML, CSS, and guard tests. The changed renderer only reads caller-supplied site files and returns rendered bytes; it does not write f…
Safe File Parsing ✅ Passed No explicit safe-file-parsing failure is introduced. The new JSON reads use encoding/json.Unmarshal into concrete structs, and malformed output returns an error. The preset dry-run runs in process a…
System Changes Are Reversible ✅ Passed The PR does not add or change code that modifies the system state categories in this check. The changed code renders static site files in memory, reads templates, and uses a temporary directory for a …
No Resource Leaks ✅ Passed No resource leak is introduced. The new guard creates one temporary directory with os.MkdirTemp and schedules os.RemoveAll with defer on every return path. The in-process CLI calls are synchronous, an…
Full details: Clear User-Facing Text

Explanation

The Polish preset page names the same concept inconsistently. The title uses “Walidacja uploadu”, while the lead and description use “formularz przesyłania”. The presets page and metadata also mix “uploadu” and “przesyłania”.

Resolution

Choose one Polish term and use it consistently in the preset title, page title, descriptions, card text, and related metadata. For example, replace the prose uses of “upload” with “przesyłanie” or “przesyłania”; keep the stable CLI identifier upload-validation unchanged.

Full details: Scope, Duplication And Docs

Explanation

The PR introduces a duplicate byte-grouping helper. internal/site/presets.go:294 adds grouped, which formats an int64 with spaces every three digits. The base revision already provides the equivalent exported internal/core.Exactly in internal/core/humanise.go:67-69, and existing CLI and GUI code use it. This is an introduced helper duplication. The PR otherwise stays within the described website feature: localized site documentation and generated pages are updated, and no CLI, configuration, build, or persisted-data contract changes appear in the diff.

Resolution

Remove internal/site.grouped and use core.Exactly(facts.Budget.Bytes) for the preset-page byte value. Import internal/core, or move the shared formatter to an appropriate common package if the site layer must remain dependency-free. Keep one implementation for grouped exact-byte formatting and retain or add coverage for the rendered budget value.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot added the enhancement New feature or request label Sep 29, 2026
@donislawdev
donislawdev merged commit adcd477 into main Sep 29, 2026
22 checks passed
@donislawdev
donislawdev deleted the site/preset-pages branch September 29, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant