-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Numeric Input] - Show "Format Options" Tooltip as List (#1861)
## Summary: Upon receiving focus, the Numeric Input field will show a tooltip indicating the format of the answer that it is expecting (assuming the input was configured with suggested formats). When multiple formats are indicated, they should be displayed as a list. Currently, the formats are indeed HTML list elements, but they don't display as list items (all formatting has been removed). This change fixes the visual formatting to display the items as a list, but only if there are two or more items. In the case of just one format example, the HTML list element is removed, and the content is displayed as regular text. Also, the first line in the tooltip is more of an introductory text than a format option, and therefore should not be included in the HTML list markup. Issue: LEMS-2457 ## Test plan: **NOTE:** Only the HTML modifications can be testing locally (aka Storybook). The visual modifications must be verified in a ZND (or locally in Webapp containerized) because the styling that interferes with the list styling does not exist in Storybook. ### Storybook: 1. Launch Storybook 1. Navigate to Perseus Editor => Editor => [Demo](http://localhost:6006/?path=/story/perseuseditor-editorpage--demo) 1. Add a Numeric Input widget 1. Configure the widget to have just one format option ![Storybook - 1 Format Option](https://github.com/user-attachments/assets/b75a0b98-9132-425f-a272-6606c30ef80a) 1. Move focus to the input field in the preview area * The tooltip should **NOT** be a list ![Storybook - 1 Format Tooltip](https://github.com/user-attachments/assets/f7e52579-0bce-45fd-af35-bf6c22352bb2) 1. Configure the widget to have more than one format option ![Storybook - 3 Format Option](https://github.com/user-attachments/assets/8df2c22a-7a3d-44a7-9cd9-723cd1542bfa) 1. Move focus to the input field in the preview area * The tooltip should be a list, with the first line of text **NOT** in the list ![Storybook - 3 Format Tooltip](https://github.com/user-attachments/assets/17a34627-7ba6-4367-b45e-c858cd63c33e) ### Webapp (locally or in a [ZND](https://prod-znd-241118-markfitz-m06.khanacademy.org/)): 1. Log into the app with a valid account for use in editing exercises 1. Navigate to a Numeric Input example * Test Everything > Unit 2 > Lesson 2: Numeric input ([ZND](https://prod-znd-241118-markfitz-m06.khanacademy.org/internal-courses/test-everything/test-everything-2-without-mastery/te-numeric-input/e/numeric-input-exercise)) 1. Edit the exercise 1. Configure the widget to have just one format option ![Storybook - 1 Format Option](https://github.com/user-attachments/assets/b75a0b98-9132-425f-a272-6606c30ef80a) 1. Move focus to the input field in the preview area (make sure the "Desktop" preview is selected) * The tooltip should **NOT** be a list ![Webapp - 1 Format Tooltip](https://github.com/user-attachments/assets/403091c1-e2ba-45aa-b5a7-c19aa76a6009) 1. Configure the widget to have more than one format option ![Storybook - 3 Format Option](https://github.com/user-attachments/assets/8df2c22a-7a3d-44a7-9cd9-723cd1542bfa) 1. Move focus to the input field in the preview area * The tooltip should be a list, with the first line of text **NOT** in the list ![Webapp - 3 Format Tooltip](https://github.com/user-attachments/assets/426f73bb-992a-44e8-8a8b-ed5b846fc2d0) Author: mark-fitzgerald Reviewers: mark-fitzgerald, jeremywiebe, SonicScrewdriver, catandthemachines Required Reviewers: Approved By: jeremywiebe, SonicScrewdriver, catandthemachines Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald Pull Request URL: #1861
- Loading branch information
1 parent
129adeb
commit 763a4ba
Showing
10 changed files
with
453 additions
and
73 deletions.
There are no files selected for viewing
This file contains 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,5 @@ | ||
--- | ||
"@khanacademy/perseus": patch | ||
--- | ||
|
||
[Numeric Input] - Show format options as a list |
This file contains 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 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 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 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 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 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 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
Oops, something went wrong.