Skip to content

Modify preview-card styles #88

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 6 commits into from
Jan 31, 2025

Conversation

jomcarvajal
Copy link
Contributor

New ExercisePreview component added (show_all_feedback: false )
Screenshot 2025-01-28 at 2 18 24 PM

New style for selected cards
Screenshot 2025-01-28 at 2 18 28 PM

@jomcarvajal jomcarvajal requested a review from a team as a code owner January 28, 2025 22:07
@jomcarvajal jomcarvajal requested review from bethshook and jivey and removed request for a team January 28, 2025 22:07
Copy link
Member

@jivey jivey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just small things and a different prop interface. Do you also want to include the smaller bubble sizes in this? The figma designs were made smaller after I made this branch.

@@ -103,7 +104,7 @@ const exerciseWithQuestionStatesProps = (): ExerciseWithQuestionStatesProps => {
is_answer_order_important: false,
answers: [{
id: '1',
correctness: undefined,
correctness: '1.0',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this break any of the other stories? Seems alright, I just can't remember why it was undefined originally

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This marks a question as correct, I can keep it as undefined and create a new variable just for new stories


.question-info {
font-weight: bold;
font-size: 1.6rem;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this match Figma? I think Figma might be slightly smaller. Also I'm not sure when that other PR will get merged, so maybe we do include the fix you made last week for the broken separator :D

Copy link
Contributor Author

@jomcarvajal jomcarvajal Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it should be 1.2rem


beforeEach(() => {
exercise = {
uid: '1@1',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are indented 4 but we use 2 in this repo (and most of the repos)

/**
* An Exercise version with less interaction with card and grants an Overlay with Include/Remove component
*/
export const ExercisePreview = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer this to take selected and onSelectionChange props, that keeps it flexible on the consuming side

@@ -160,7 +160,7 @@ export const mixins = {
.answer-letter-wrapper::before {
color: ${invertBubble ? '#fff' : color};
border-color: ${color};
${invertBubble ? `background-color: ${color};` : null}
${invertBubble ? `background-color: ${color} !important;` : null}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which style is this overriding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a card is selected, all background should change color(including letter wrappers). But when a letter is marked as correct, I forced to overrides the "correct theme"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see now, I didn't realize we set an explicit background on those

@jomcarvajal
Copy link
Contributor Author

Looking good, just small things and a different prop interface. Do you also want to include the smaller bubble sizes in this? The figma designs were made smaller after I made this branch.

@jivey bubbles mean "answer-letters" ?

@jivey
Copy link
Member

jivey commented Jan 29, 2025

@jomcarvajal Yeah I think the answer-letter-wrapper maybe? I was thinking of the bubbleSize setting in theme that the normal component uses

@jomcarvajal jomcarvajal requested a review from jivey January 29, 2025 19:40
@jomcarvajal jomcarvajal merged commit 946c936 into preview-card Jan 31, 2025
1 check passed
@jomcarvajal jomcarvajal deleted the CORE-675-new-styles-for-preview-card branch January 31, 2025 13:40
jomcarvajal added a commit that referenced this pull request May 2, 2025
* card styles

* Overlay option added in exercise component and new component IncludeRemoveQuestion created (#86)

* overlay option added in exercise component and new component includeremovequestion created

* resolve comments

* update snapshots

* move overlay logic into Card component

* remove focus on card when overlay is up and add autoFocus for first interactive element on overlay

* Add export for IncludRemoveQuestion (#87)

add export of IncludRemoveQuestion

* Modify preview-card styles (#88)

* modify preview card styles

* change color of card when is included

* resolve comments - fix style issues

* change props in storybook of Exercise

* Add prop method for details button

* Refactor props of ExercisePreview

* export ExercisePreview

* remove focus first for screenreaders, style tweaks

* Remove aria attributes in order to read card body content (#90)

* remove aria attributes in order to read card body content

* conditional aria attributes for cardbody

* previewMode in storybook

* missing previewMode prop

* fix some type issues

* disable eslint rule for ts-ignore just for this case

* Core 675 refactor exercise preview (#92)

* remove includeRemove logic from preview exercise card

* print stories deleted by mistake

* test description fixed

* added new story for preview exercise, hide all feedback propertly

* revert print delete

* remove questionState prop, added feedback inside answers for stories purposes

* is_completed added into ExercisePreview component

* update snapshots

* New prop showCorrectAnswer (#93)

* new prop showCorrectAnswer

* fix exercise stories

* ExercisePreview now shows question detailed (#94)

* ExercisePreview now shows question detailed

* Restore print

* hide footer with new condition

* Restore print

* fix indentation in ExerciseQuestion

* set answer_id as empty

* set new margin for preview card

* update snaps

* resolve test duplicity

---------

Co-authored-by: jomcarvajal <[email protected]>
Co-authored-by: jomcarvajal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants