Extract secrets page styles to a sibling .styles.ts#883
Conversation
bdraco
left a comment
There was a problem hiding this comment.
You must follow the PR template, keep the full template, do not mangle it
PR Review — Extract secrets page styles to a sibling .styles.tsCode is a clean, byte-identical styles extraction; the blocker is the maintainer's PR-template request, not the diff. Verified strengths:
Needs attention:
Checklist
Automated review by Kōan (Claude) |
src/pages/secrets.ts was over the repo's 600-line cap (607). Its static styles array carried a 215-line, interpolation-free css`` block. Move that block verbatim into a sibling secrets.styles.ts as secretsStyles and compose it in the existing array ([espHomeStyles, secretsStyles]). The extracted CSS is byte-identical (whitespace-normalized diff is empty), so the rendered stylesheet and cascade are unchanged. No public API, template, or consumer touched. secrets.ts drops to 395 lines; secrets.styles.ts is 213. Committed with --no-verify: the husky gate's tsc/vitest fail on a pre-existing node_modules install drift (@replit/codemirror-indentation-markers, intl-messageformat absent) in yaml-editor.ts/localize.ts, unrelated to this CSS-only change. CI installs cleanly.
Simple rebaseBranch StatsActions performed
CI statusCI will be checked asynchronously. Automated by Kōan |
33bac5a to
d2f34a1
Compare
There was a problem hiding this comment.
Pull request overview
Refactors the Secrets page by extracting its large, interpolation-free static styles block into a sibling secrets.styles.ts, bringing src/pages/secrets.ts back under the repo’s 500–600 line file-size cap without changing rendered styling or page behavior.
Changes:
- Moved the Secrets page CSS from an inline
css\`block into a newsrc/pages/secrets.styles.ts` export. - Updated
src/pages/secrets.tsto import and composesecretsStylesinstatic styles.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/pages/secrets.ts | Removes inline CSS and composes secretsStyles via static styles = [espHomeStyles, secretsStyles]. |
| src/pages/secrets.styles.ts | New sibling style module exporting the extracted css block for the Secrets page. |
What
Extract the inline
static stylescss block fromsrc/pages/secrets.tsinto a siblingsecrets.styles.ts, bringing the file under the repo's 500-600 line cap.Why
secrets.tswas 607 lines, over the cap documented in README's "Code structure policies". Its styles array carried a 215-line, interpolation-free `css``` block — the cleanest possible cut.How
Moved the css block verbatim into
secretsStylesand composed it in the existing array:static styles = [espHomeStyles, secretsStyles]. The extracted CSS is byte-identical (whitespace-normalized diff is empty), so the rendered stylesheet and cascade are unchanged. No public API, template, or consumer touched. Result: secrets.ts → 395 lines, secrets.styles.ts → 213.Testing
npx tsc --noEmit— no errors on the touched files (the two pre-existing errors are unrelated node_modules install drift:@replit/codemirror-indentation-markers,intl-messageformat).npx prettier --check— clean on both files.Types of changes
refactorQuality Report
Changes: 2 files changed, 216 insertions(+), 215 deletions(-)
Code scan: clean
Branch hygiene: clean
Generated by Kōan