fix(view): welcome page no longer shows "Wheels - Error" browser title (#3175) - #3187
Conversation
#3175) The shared _header_simple.cfm partial hardcoded <title>Wheels - Error</title>, but it is included by both the error page (EventMethods.$runOnError, where that title is correct) and the fresh-install welcome page (congratulations.cfm, where it is wrong). Parameterize the title: default it to "Wheels" and have the error handler set request.wheels.pageTitle = "Wheels - Error" before including the partial. Every successful first boot now renders a tab titled "Wheels" instead of "Error". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Wheels Bot — No doc updatesReviewed this PR's diff and found no docs that need updating (purely internal bug fix — corrects a hardcoded |
There was a problem hiding this comment.
Wheels Bot — Reviewer
TL;DR: This PR fixes #3175 — the fresh-install welcome page rendered a browser tab titled Wheels - Error because the shared _header_simple.cfm partial hardcoded that title. The fix parameterizes the title (default Wheels, request-scoped override) and correctly preserves the error-page title via request.wheels.pageTitle in EventMethods.$runOnError. The change is correct, well-tested, and cross-engine safe. Verdict: comment — no blocking findings; one minor commit-message nit below.
What was verified
- Consumer completeness —
git grep _header_simpleconfirms exactly two render-time consumers:vendor/wheels/public/views/congratulations.cfm:6(gets the newWheelsdefault) andvendor/wheels/events/EventMethods.cfc:110(gets theWheels - Erroroverride set at line 107, before the include). The PR body's correction of the triage comment is accurate. - No key collision —
request.wheels.pageTitleis written nowhere else in the framework; the only reader is the new block in_header_simple.cfm:42-49. - Guard asymmetry is moot —
EventMethods.cfc:106skips the override whenrequest.wheelsis missing/non-struct, which would theoretically leave an error page titledWheels; but the very next pre-existing line (EventMethods.cfc:109) dereferencesrequest.wheelsunconditionally, so no such request reaches the header include anyway. - Failing-by-construction — against the old hardcoded
<title>Wheels - Error</title>, the spec'sexpect(html).toInclude("<title>Wheels</title>")fails (the old string does not contain that substring), soHeaderSimpleTitleSpec.cfcgenuinely pins the regression. - Cross-engine — the spec's semicolon-less arrow-function style matches 10+ existing view specs (e.g.
guidesRedirectHeadSpec.cfc); thefinallyblock contains only aStructDeletecall (safe per Cross-Engine Invariant 12 — only loops infinallymiscompile on Lucee 7); nolocal.Xwrites inside acatch(Invariant 11);EncodeForHTMLis available on every supported engine. Rendering framework partials viaapplication.wo.$includeAndReturnOutputin specs has prior art (debugBarEncodingSpec.cfc:39). - In-suite side effect is inert — rendering the partial sets
request.wheels.showDebugInformation = true(_header_simple.cfm:11, pre-existing). This cannot corrupt suite output:vendor/wheels/events/init/debugging.cfmforcesshowDebugInformationoff outsidedevelopment, and the JSON/TXT/JUnit result renderers each re-set the request flag tofalse(public/tests/json.cfm:12,txt.cfm:9,junit.cfm:8). - XSS — the new
#EncodeForHTML(local.simpleHeaderTitle)#output encoding is a strict hardening improvement over the previous static literal. - Changelog — fragment present at
changelog.d/3175-header-simple-welcome-title.fixed.mdwith a validfixedtype; no directCHANGELOG.mdedit. ✓
Commits
- Nit (non-blocking): the commit body of
ce83a278bis a single ~500-character line.commitlint.config.jsextends@commitlint/config-conventional, which carriesbody-max-line-length: [2, 'always', 100], and CLAUDE.md § Commit Message Conventions documents "body lines ≤ 100 chars". The enforced CI gate (pr.ymlcommitlintjob) only lints the PR title — which passes (fix(view): …, valid type, ≤ 100 chars) — and recently merged commits (e.g. the Dependabot bumpc94be0500) also carry >100-char body lines, so this does not block. For future bot commits, wrap body paragraphs at 100 columns.
Tests
- Optional hardening (non-blocking): the first spec in
HeaderSimpleTitleSpec.cfcdeletesrequest.wheels.pageTitleas setup but never restores a pre-existing value. Today nothing else in the framework writes that key outside error handling, so there is no observable leak — but mirroring the second spec'stry/finallysnapshot-and-restore would make the spec order-independent against future writers. Take it or leave it.
No Correctness, Cross-engine, or Security findings. Docs deferral to bot-update-docs.yml is appropriate for a framework-internal title fix, and the feature-completeness checklist is filled honestly (the local-runner limitation is disclosed rather than checked off).
|
Superseded by #3195 (merged): a propose-fix draft that raced the ForgeBox path-repair campaign for the same issue; the campaign PR landed first and closed the underlying issue. Closing the duplicate. |
Summary
The shared
_header_simple.cfmpartial hardcoded<title>Wheels - Error</title>. That partial is included by both the error page (EventMethods.$runOnError, where the error title is correct) and the fresh-install welcome page (congratulations.cfm, where it is wrong) — so every successful first boot rendered a browser tab titledError. This parameterizes the title: the partial now defaults its<title>toWheels, and the error handler setsrequest.wheels.pageTitle = "Wheels - Error"before including the partial so error screens keep their error-specific title.Note on triage accuracy: the triage comment stated
congratulations.cfmwas the only consumer of the partial. That is not correct —EventMethods.cfc:104also includes it for the error page. A flat hardcode swap toWheelswould therefore have broken the error-page title, which is why the title is parameterized (default + request-scoped override) rather than simply replaced.Related Issue
Fixes #3175
Type of Change
Feature Completeness Checklist
Signed-off-by: claude[bot](git commit -s)vendor/wheels/tests/specs/view/HeaderSimpleTitleSpec.cfcrenders the partial via$includeAndReturnOutputand asserts the welcome-page default<title>isWheels(and is notWheels - Error), plus that arequest.wheels.pageTitleoverride is honoured so error screens keepWheels - Errorbot-update-docs.ymlbot-update-docs.ymlbot-update-docs.ymlchangelog.d/3175-header-simple-welcome-title.fixed.mdwheelsCLI binary is not installed in this bot environment:tools/test-local.shaborts at server start withnohup: failed to run command 'wheels': No such file or directory, and the sandbox confines filesystem access to the repo working tree, so the runner could not be installed or located. Verification is delegated to CI —bot-tdd-gateenforces the spec+implementation diff, and the compat-matrix runs the actual TestBox suite across engines. The spec is failing-by-construction against the previous hardcodedWheels - Errortitle and passes against this change.Test Plan
Wheels(previouslyWheels - Error).Wheels - Error.HeaderSimpleTitleSpec.cfcexercises both paths headlessly via the framework test object.