Skip to content

[Label Image] Modernize the label-image answer-choices controls (delete custom Link component)#3797

Merged
ivyolamit merged 3 commits into
mainfrom
LEMS-4131/editor-modernize-link
Jun 18, 2026
Merged

[Label Image] Modernize the label-image answer-choices controls (delete custom Link component)#3797
ivyolamit merged 3 commits into
mainfrom
LEMS-4131/editor-modernize-link

Conversation

@ivyolamit

Copy link
Copy Markdown
Contributor

Summary:

Modernize the label-image answer-choices controls (delete custom Link component)
This is a follow-up PR based on this comment replacing old component with WB component. This PR also delete an unused "order" functionality that was not really implemented based on history:

Issue: LEMS-4131

Test plan:

…rnize the label-image answer-choices controls (delete custom Link component)
…mage answer-choices controls (delete custom Link component)
@ivyolamit ivyolamit self-assigned this Jun 18, 2026
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Size Change: -1.04 kB (-0.2%)

Total Size: 512 kB

📦 View Changed
Filename Size Change
packages/perseus-editor/dist/es/index.js 104 kB -1.04 kB (-0.99%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.6 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 6.32 kB
packages/math-input/dist/es/index.js 98.5 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 12.3 kB
packages/perseus-core/dist/es/index.js 27.3 kB
packages/perseus-linter/dist/es/index.js 9.8 kB
packages/perseus-score/dist/es/index.js 10.2 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 203 kB
packages/perseus/dist/es/strings.js 8.6 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (8d093ef) and published it to npm. You
can install it using the tag PR3797.

Example:

pnpm add @khanacademy/perseus@PR3797

If you are working in Khan Academy's frontend, you can run the below command.

./dev/tools/bump_perseus_version.ts -t PR3797

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -t PR3797

@ivyolamit

Copy link
Copy Markdown
Contributor Author

Screenshot

Before After
Screenshot 2026-06-18 at 9 17 23 AM Screenshot 2026-06-18 at 9 16 40 AM

: styles.addAnswer
}
aria-disabled={editingDisabled || undefined}
<Clickable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Used Clickable here instead of Button or IconButton to make it more flexible with the proper alignment of the minus and add circle icon. Doing it in Button or IconButton will not align properly.

className={styles.disabled}
title="Answer reordering is not implemented."
>
<DraggableGripIcon />

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deleted this since this is not used or fully implemented.

@ivyolamit ivyolamit requested a review from a team June 18, 2026 16:25
@ivyolamit ivyolamit marked this pull request as ready for review June 18, 2026 16:25

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Amazing! Glad to get rid of this!

Add an answer choice
</Link>
{() => (
<span className={styles.addAnswerContent}>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this use a WB typography component here?

<Icon icon={removeIcon} size={24} color="#D92916" />
</Link>
{() => (
<span className={styles.removeButtonContent}>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same about WB typography?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good call, wrapped the label in BodyText and dropped the hand-rolled font CSS. Kept the outer though: it's the flex row laying out the icon next to the text BodyText can't take that role since it hard-codes display: block. And it stays a rather than

because Clickable renders a , which only allows phrasing content.

@ivyolamit

Copy link
Copy Markdown
Contributor Author

Screen shot based on latest changes

image

}: SelectImageProps): React.ReactElement => (
<div>
<div className={styles.title}>Image</div>
<BodyText weight="bold" tag="span">

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made this consistent so it would look nice.

@ivyolamit ivyolamit merged commit 11d3ec0 into main Jun 18, 2026
12 checks passed
@ivyolamit ivyolamit deleted the LEMS-4131/editor-modernize-link branch June 18, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants