-
Notifications
You must be signed in to change notification settings - Fork 1
Phase 2.2: Modal Components Migration #2825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7b460d1
Phase 2.2: Migrate Modal components to plain CSS
OpenStaxClaude 021d96b
Address Copilot review comments
OpenStaxClaude 61f8479
Configure stylelint to lint both styled-components and plain CSS files
OpenStaxClaude bde54d4
Address final Copilot review comments (Review #31)
OpenStaxClaude 12d31bd
Merge branch 'main' into phase-2.2-modal-migration
staxly[bot] 61d1126
Merge branch 'main' into phase-2.2-modal-migration
staxly[bot] 61bbdec
Merge branch 'main' into phase-2.2-modal-migration
staxly[bot] ba7c4a3
Merge branch 'main' into phase-2.2-modal-migration
staxly[bot] be6570f
Merge branch 'main' into phase-2.2-modal-migration
staxly[bot] 47f0dab
Merge branch 'main' into phase-2.2-modal-migration
staxly[bot] 14de174
Merge branch 'main' into phase-2.2-modal-migration
staxly[bot] 2ed1f27
Merge branch 'main' into phase-2.2-modal-migration
staxly[bot] 12a619b
Merge branch 'main' into phase-2.2-modal-migration
staxly[bot] ad5ca63
Merge branch 'main' into phase-2.2-modal-migration
staxly[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| /** | ||
| * Modal component styles | ||
| * Migrated from styled-components to plain CSS | ||
| */ | ||
|
|
||
| /* Modal wrapper - full screen fixed overlay */ | ||
| .modal-wrapper { | ||
| position: fixed; | ||
| top: 0; | ||
| left: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| z-index: var(--modal-z-index, 10000); | ||
|
RoyEJohnson marked this conversation as resolved.
|
||
| } | ||
|
|
||
| /* Card wrapper - z-index container */ | ||
| .modal-card-wrapper { | ||
| z-index: 1; | ||
| } | ||
|
|
||
| /* Main modal card */ | ||
| .modal-card { | ||
| display: flex; | ||
| flex-direction: column; | ||
| margin: auto; | ||
| overflow: hidden; | ||
| width: 40rem; | ||
| background-color: white; | ||
| box-shadow: 0 0 2rem rgba(0, 0, 0, 0.05), 0 0 4rem rgba(0, 0, 0, 0.08); | ||
|
|
||
| /* bodyCopyRegularStyle - font-size: 1.6rem, line-height: 2.5rem, color from theme */ | ||
| font-size: 1.6rem; | ||
| line-height: 2.5rem; | ||
| color: var(--text-color, #424242); | ||
| } | ||
|
|
||
|
RoyEJohnson marked this conversation as resolved.
|
||
| /* Link styling inside modal card - mirrors bodyCopyRegularStyle link behavior */ | ||
| .modal-card a { | ||
| color: var(--link-color, #027eb5); | ||
| cursor: pointer; | ||
| text-decoration: underline; | ||
| } | ||
|
|
||
| .modal-card a:hover { | ||
| color: var(--link-hover-color, #0064a0); | ||
| } | ||
|
|
||
| /* Modal header */ | ||
| .modal-header { | ||
| display: flex; | ||
| align-items: center; | ||
| margin-bottom: 1.5rem; /* modalPadding * 0.5 = 3.0 * 0.5 */ | ||
| padding: 1.5rem 3rem; /* modalPadding * 0.5, modalPadding */ | ||
| background: var(--header-bg, #f1f1f1); | ||
| border-bottom: solid 0.1rem var(--header-border, #fafafa); | ||
| justify-content: space-between; | ||
| } | ||
|
|
||
| /* Modal heading (h1 with h4 style) */ | ||
| .modal-heading { | ||
| /* h4Style from Typography/Headings.legacy.ts */ | ||
| font-size: 1.8rem; | ||
| line-height: 2.5rem; | ||
| letter-spacing: -0.02rem; | ||
| padding: 1rem 0 1rem 0; | ||
| margin: 0; | ||
| color: var(--text-color, #424242); | ||
|
|
||
| /* Additional heading styles */ | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
|
|
||
| @media screen and (max-width: 75em) { | ||
| .modal-heading { | ||
| /* h4MobileStyle */ | ||
| font-size: 1.6rem; | ||
| line-height: 2rem; | ||
| } | ||
| } | ||
|
|
||
| /* Modal body heading (h3) */ | ||
| .modal-body-heading { | ||
| /* h3Style from Typography/Headings.legacy.ts */ | ||
| font-size: 2.4rem; | ||
| line-height: 3rem; | ||
| letter-spacing: -0.02rem; | ||
| margin: 0; | ||
| color: var(--text-color, #424242); | ||
|
|
||
| /* Additional styles from BodyHeading */ | ||
| font-weight: 400; | ||
| padding: 1.5rem 0; /* modalPadding * 0.5 */ | ||
| } | ||
|
RoyEJohnson marked this conversation as resolved.
|
||
|
|
||
| @media screen and (max-width: 75em) { | ||
| .modal-body-heading { | ||
| /* h3MobileStyle */ | ||
| font-size: 1.6rem; | ||
| line-height: 2rem; | ||
| } | ||
| } | ||
|
|
||
| /* Modal body */ | ||
| .modal-body { | ||
| display: flex; | ||
| flex-direction: column; | ||
| padding: 0 3rem; /* modalPadding */ | ||
| } | ||
|
|
||
| /* Special case: when Card.Header + Body, remove top margin */ | ||
| .modal-card .modal-header + .modal-body { | ||
| margin-top: 0; | ||
| } | ||
|
|
||
| /* Modal mask - semi-transparent backdrop */ | ||
| .modal-mask { | ||
| position: fixed; | ||
| top: 0; | ||
| left: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| display: flex; | ||
| background-color: rgba(0, 0, 0, 0.3); | ||
| } | ||
|
|
||
| /* Modal footer */ | ||
| .modal-footer { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| padding: 3rem; /* modalPadding */ | ||
| } | ||
|
|
||
| /* Close modal icon button */ | ||
| .modal-close-icon { | ||
| /* Final legacy CloseModalIcon size: 2rem x 2rem */ | ||
| height: 2rem; | ||
| width: 2rem; | ||
| padding: 0.4rem; | ||
|
|
||
| /* Base button styles */ | ||
| cursor: pointer; | ||
| margin-right: 0; | ||
| padding-right: 0; | ||
| background: none; | ||
| border: none; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
|
|
||
| /* toolbarIconColor.lighter */ | ||
| color: var(--icon-color-lighter, #c5c5c5); | ||
| } | ||
|
|
||
| .modal-close-icon:hover { | ||
| /* toolbarIconColor.base */ | ||
| color: var(--icon-color-base, #5e6062); | ||
| } | ||
|
|
||
| .modal-close-icon > svg { | ||
| height: 100%; | ||
| width: 100%; | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,29 @@ import renderer from 'react-test-renderer'; | |
| import Modal from '.'; | ||
| import TestContainer from '../../../test/TestContainer'; | ||
|
|
||
| /** | ||
| * NOTE ON TRAILING SPACES IN SNAPSHOTS: | ||
| * | ||
| * The snapshot tests may show trailing spaces in className attributes (e.g., "modal-body "). | ||
| * This is a test artifact caused by Jest's snapshot serialization process. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't we avoid this by using |
||
| * | ||
| * Explanation: | ||
| * - The legacy styled-components wrappers (styles.legacy.tsx) wrap plain components using styled() | ||
| * - These wrappers generate styled-components class names like "styleslegacy__Body-m93cxn-6 dmUpwe" | ||
| * - During snapshot serialization, Jest strips out these generated styled-components classes | ||
| * - This leaves the original "modal-body" class with a trailing space where the styled class was | ||
| * | ||
| * Example: | ||
| * - Runtime className: "modal-body styleslegacy__Body-m93cxn-6 dmUpwe" | ||
| * - After Jest stripping: "modal-body " | ||
|
RoyEJohnson marked this conversation as resolved.
|
||
| * | ||
| * This does NOT occur in actual runtime - browsers receive the full className with both the base | ||
| * class and styled-components classes. The trailing space only appears in test snapshots. | ||
| * | ||
| * This artifact will resolve itself once the legacy styled-components wrappers are removed in | ||
| * future migration phases. | ||
| */ | ||
|
|
||
| describe('Modal', () => { | ||
| it('matches snapshot', () => { | ||
| const component = renderer.create(<TestContainer> | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just the plan but you gotta watch out for Claude randomly casting stuff as any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint calls them out.