Skip to content

Jd 58/#104 challenge card component#116

Open
jd-58 wants to merge 6 commits intomsbelaid:masterfrom
jd-58:jd-58/#104_challenge_card_component
Open

Jd 58/#104 challenge card component#116
jd-58 wants to merge 6 commits intomsbelaid:masterfrom
jd-58:jd-58/#104_challenge_card_component

Conversation

@jd-58
Copy link
Copy Markdown

@jd-58 jd-58 commented Mar 7, 2026

This is in reference to issue #104. This PR implements the challenge card component, using the recently added PlugButton and PlugNumericalInput components, along with screenshot tests. Please let me know if you have any requested changes, and I will fix/implement your suggestions. Thank you!

Copy link
Copy Markdown
Owner

@msbelaid msbelaid left a comment

Choose a reason for hiding this comment

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

Awesome! thanks for your contribution
Left some comments

// Challenge text
Text(
text = challengeText,
style = MaterialTheme.typography.displayLarge.copy(fontWeight = FontWeight.Bold),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Let's make the text auto resizable so that if it exceeds the available width, it shrinks instead of overflowing. This might require upgrading the Jetpack Compose library. If the autoSize property isn’t recognized, please keep the current implementation as it is, I’ll update it after upgrading the library..

Suggested change
style = MaterialTheme.typography.displayLarge.copy(fontWeight = FontWeight.Bold),
style = MaterialTheme.typography.displayLarge.copy(fontWeight = FontWeight.Bold),
maxLines = 1,
autoSize = TextAutoSize.StepBased(
minFontSize = MaterialTheme.typography.headlineMedium.fontSize,
maxFontSize = MaterialTheme.typography.displayLarge.fontSize,
stepSize = 1.sp
)

value = inputValue,
onValueChange = onInputChange,
onSubmit = onCheckAnswer,
placeholder = stringResource(R.string.plug_card_input_placeholder),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please make the placeholder value generic by adding a parameter to PlugCard.


// Check answer button
PlugButtonSecondary(
text = stringResource(R.string.plug_card_check_answer),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The CTA title should also be a compose parameter.

Comment on lines +60 to +61
<string name="plug_card_input_placeholder">Write your answer</string>
<string name="plug_card_check_answer">Check your answer</string>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

No need to add string resources here, as we want this to be customizable.

import org.junit.Rule
import org.junit.Test

class PlugCardScreenshotTest {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Awesome, thanks for adding the screenshot tests.

Could you please record the screenshots by running ./gradlew recordPaparazziDebug? This will generate PNG images in app/src/test/snapshots/images/.

You can then commit these new images.

@msbelaid
Copy link
Copy Markdown
Owner

@jd-58 , just checking in to see if you’ve had a chance to make the updates. Let me know if you need any clarification or help.

@jd-58
Copy link
Copy Markdown
Author

jd-58 commented Mar 17, 2026

@jd-58 , just checking in to see if you’ve had a chance to make the updates. Let me know if you need any clarification or help.

Thank you for the comments! My apologies for the delay. I will work on implementing these changes this week.

@jd-58 jd-58 force-pushed the jd-58/#104_challenge_card_component branch from 0481d62 to ac4d4f4 Compare March 25, 2026 01:34
@jd-58
Copy link
Copy Markdown
Author

jd-58 commented Mar 25, 2026

I just pushed an update addressing your feedback. I had some issues with having my library out of sync with some changes in main I believe, so I attempted to rebase my changes to resolve the conflicts that arose. My apologies for the mix up!

@jd-58 jd-58 requested a review from msbelaid March 25, 2026 01:39
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