[perf] Replace inline styles in challenge edit page with CSS module classes#125
Open
github-actions[bot] wants to merge 1 commit intomainfrom
Open
[perf] Replace inline styles in challenge edit page with CSS module classes#125github-actions[bot] wants to merge 1 commit intomainfrom
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
Move 7 static inline style objects from challenge/edit/[id]/page.tsx into challenge.module.css, eliminating per-render object allocation on every render of the edit page. New CSS classes added to challenge.module.css: - .editLoadingCenter (display:flex; align-items:center; justify-content:center; min-height:400px) - .editFormContainer (max-width:700px; margin:0 auto; padding:24px) - .editFormHeader (margin-bottom:24px) - .editIconAccent (color:var(--fgColor-accent)) - .editActionTop (margin-top:16px) -- shared by both error-state buttons - .editActionsFooter (margin-top:16px) -- form submit row - .editSaveErrorBanner (margin-bottom:16px) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
Pull request created: #125 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tier: 2 — Render & API Performance
Replaces 7 static inline
style=\{\{}}objects insrc/app/challenge/edit/[id]/page.tsxwith CSS module classes, eliminating per-render JavaScript object allocation on a'use client'page.Baseline
Before this change,
challenge/edit/[id]/page.tsxcontained 7 inline style objects that were re-created as new JS objects on every render:Each
style=\{\{}}literal allocates a new object per render in JavaScript. Moving these to CSS module classes makes them zero-cost at runtime (static class strings).Fix
Added 7 new classes to
src/app/challenge/challenge.module.css:.editLoadingCenterdisplay:flex; align-items:center; justify-content:center; min-height:400px.editFormContainermax-width:700px; margin:0 auto; padding:24px.editFormHeadermargin-bottom:24px.editIconAccentcolor:var(--fgColor-accent).editActionTopmargin-top:16px(used on 2 error-state buttons).editActionsFootermargin-top:16px(form submit row).editSaveErrorBannermargin-bottom:16pxAll values are static (non-dynamic), making this a safe mechanical replacement with zero behaviour change.
Result
style=\{\{}}objects remain inedit/[id]/page.tsx(was 7)Verification
npm run lint— passes (0 errors)npm test— 1025/1035 tests pass; 10 failures are pre-existing insrc/lib/github/client.test.ts,profile.test.ts,workspace-export.test.ts(unrelated to this change)style=\{\{}}remains in the changed file