Repository navigation
Solved issue #182 Curiosity Mode UI breakage, missing Visual Riddle i… - #401
Conversation
…isual Riddle images, duplicate Vachana menu entry, and quiz UI breakdown (Column Addition & Addition)
✅ Parikshak — all automated checks pass
This is Parikshak, an automated, comment-only check — it never closes or approves a PR. A human reviewer still makes the final call. See |
|
🎉 Welcome @swatijain200701-sys — this looks like your first pull request in this repo! A few friendly tips:
If you get stuck, ask away in the PR comments. Good luck! |
|
Hi @swatijain200701-sys, thank you so much for this pull request, and for your patience; we are sorry it waited so long for a review. We tested it on the latest
Two things are left before we can merge, and one small tidy-up. We tested each step ourselves, so the code below is safe to copy. 1. The duplicate menu entries are still there (issue 3) Please delete this whole second block (on your branch it is lines 45883 to 45893, right after the {featuredApps.map(app => (
<button key={app.key} onClick={() => { setMenuOpen(false); onSelect(app.key) }} style={{
display: 'block', width: '100%', textAlign: 'left', padding: '10px 16px',
background: 'none', border: 'none', cursor: 'pointer', color: 'var(--clr-text)',
fontFamily: 'var(--font-body)', fontSize: '0.95rem', transition: 'background var(--transition)'
}} onMouseEnter={e => e.target.style.background = 'var(--clr-hover-strong)'}
onMouseLeave={e => e.target.style.background = 'none'}>
<strong style={{ color: 'var(--clr-accent)' }}>{app.name}</strong>
<span style={{ display: 'block', fontSize: '0.78rem', color: 'var(--clr-text-soft)', marginTop: '2px' }}>{app.subtitle}</span>
</button>
))}Please do not delete the 2. Please remove the 8 image files you added git rm client/public/riddles/images/*.png
git commit -m "chore: remove duplicate riddle images (served from server/riddles/images)"What you should see: the Visual Riddles still show their 4 images (Visual Pattern, Shape Sequence, Missing Piece, Number Clock) when you run the app with the server running. 3. A small tidy-up of the description To check, from the npm run lint # expect 0 errors
npm run build # expect no errorsPlease keep Thank you, |
|
🚀 @swatijain200701-sys — your first merged PR in this repo! Welcome to the contributors club 🎊 |
|
🌐 Polyglot @swatijain200701-sys! First merged PR — bringing fresh skills to the table. Variety is the spice of open source. 🌮 |
Closes Issue #182 — Curiosity Mode UI Breakage, Missing Visual Riddle Images, Duplicate "Vachana" Menu Entry, and Quiz UI Breakdown (Column Addition & Addition)
Closes #182
📋 Summary
This PR resolves four separate bugs reported in issue #182 that collectively broke key parts of the Tenali math learning app:
App.csssrcpath + missing image filesApp.jsx+client/public/riddles/images/EquationToStory.jsxApp.jsx🐛 Bug 1 — Curiosity Mode UI Breakage
What Was Broken
The Curiosity Mode editor page was completely unreadable on most screen widths. The two-column layout used a hard-coded
minmax(380px, 0.68fr)for the right panel which caused:grid-template-columnswith 9 columns that broke at any width under ~900pxRoot Cause
Fix Applied
Replaced all fixed/overflowing grid definitions with fluid
minmax(0, …)/flex-wrapalternatives. Addedmin-width: 0to every grid child that was overflowing, andword-break: break-word/overflow-wrap: anywhereon all text containers.Files changed:
client/src/App.css🐛 Bug 2 — Missing Visual Riddle Images
What Was Broken
Math Riddles with
type: "image-numpad"andtype: "image-option"showed a broken image placeholder or nothing at all. The riddle image area was completely empty for visual puzzle questions.Two separate problems caused this:
Problem A — Wrong image
srcpath:Option images were passed as bare filenames (e.g.
"riddles/images/game_puzzle_112_option_a.png") but were never prefixed with the app's base URL (ViteBASE_URL). On sub-path deployments thesrcresolved to a 404.Also added a proper
onErrorhandler on the main riddle image so failures are surfaced in the console instead of silently broken:Problem B — Image files were missing entirely:
The following 8 image files did not exist in the repo under
client/public/riddles/images/:game_puzzle_100.pnggame_puzzle_104.pnggame_puzzle_105.pnggame_puzzle_112.pnggame_puzzle_112_option_a.pnggame_puzzle_112_option_b.pnggame_puzzle_112_option_c.pnggame_puzzle_112_option_d.pngAll 8 files have been added to
client/public/riddles/images/.Files changed:
client/src/App.jsx,client/public/riddles/images/(8 new files added)🐛 Bug 3 — Duplicate Menu Entries (Random Mix, Custom Lesson, Gym, Treasure Hunt, Contrast Challenge and Vachana)
What Was Broken
In the ☰ menu on the Puzzles page, every featured entry appeared twice: Random Mix, Custom Lesson, Gym, Treasure Hunt, Contrast Challenge and Vachana, not only Vachana.
Before:
Root Cause
In
client/src/App.jsx, the menu already prints these entries once through thefilteredHamburgerApps.map(...)block, which includes the featured entries. A secondfeaturedApps.map(...)block then printed them all again.Fix Applied
Removed the redundant second
{featuredApps.map(app => ( ... ))}block so each entry appears only once. ThefilteredHamburgerApps.map(...)block above it was left untouched, because the menu search depends on it.After:
Files changed:
client/src/App.jsx🐛 Bug 4 — Quiz UI Breakdown (Column Addition & Addition)
What Was Broken
The Column Addition and Addition quiz pages had broken UI layouts:
image-optiontype questions (should be hidden)Root Cause
Inside
App.jsx, the Math Riddles component's JSX nesting had an off-by-one indentation/closure error introduced in a prior refactor. Thestage === 'playing'block was wrapped inside thestage === 'setup'conditional block instead of being a sibling. This caused:{!revealed && (question.type !== 'image-option')}guard condition short-circuiting incorrectlydisabledcondition evaluating against an undefinedselectedOptionstateFix Applied
Corrected the JSX block nesting — the
stage === 'playing'andstage === 'results'fragments were moved to be proper siblings ofstage === 'setup'at the same JSX level:Files changed:
client/src/App.jsx📁 Files Changed
✅ Testing Checklist
withBase()path correction and render on sub-path deploymentsimage-optiontype riddle questionsnpm run buildpasses with exit code 0 (verified locally)🔗 Related
42e25a98