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
[Dev UI] Display info about background image of current question #1222
Conversation
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
Size Change: -7 B (0%) Total Size: 833 kB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so good! Love the UI polish 😀
.map((w) => w.options.backgroundImage?.url ?? "") | ||
.filter((url) => url.length > 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty string, null, and undefined are all falsey, so this could be simplified to
.map((w) => w.options.backgroundImage?.url ?? "") | |
.filter((url) => url.length > 0), | |
.map((w) => w.options.backgroundImage?.url) | |
.filter(Boolean), |
That might be too much magic, though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd love to do that, but Typescript doesn't seem to understand the narrowing that occurs in .filter(Boolean)
.
69478e4
to
bd8b693
Compare
9833e5d
to
9f6f738
Compare
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (631270b) and published it to npm. You Example: yarn add @khanacademy/perseus@PR1222 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR1222 |
53f260c
to
da05d91
Compare
da05d91
to
6ed283d
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1222 +/- ##
==========================================
+ Coverage 68.64% 69.87% +1.23%
==========================================
Files 470 474 +4
Lines 100733 100798 +65
Branches 7146 10774 +3628
==========================================
+ Hits 69148 70436 +1288
+ Misses 31406 30362 -1044
+ Partials 179 0 -179
... and 131 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @khanacademy/perseus@22.4.0 ### Minor Changes - [#1229](#1229) [`3c1e398d5`](3c1e398) Thanks [@mark-fitzgerald](https://github.com/mark-fitzgerald)! - Show Arrowheads on Locked Lines in Interactive Graphs - [#1237](#1237) [`54689a18f`](54689a1) Thanks [@handeyeco](https://github.com/handeyeco)! - Rough out new Circle Graph behind a feature flag ### Patch Changes - [#1222](#1222) [`44cf7348c`](44cf734) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix @phosphor-icon paths in `explanation` widget - [#1243](#1243) [`ee89a1b01`](ee89a1b) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix dash style for locked lines when kind is 'ray' ## @khanacademy/perseus-editor@6.2.1 ### Patch Changes - [#1237](#1237) [`54689a18f`](54689a1) Thanks [@handeyeco](https://github.com/handeyeco)! - Rough out new Circle Graph behind a feature flag - [#1246](#1246) [`d66b79e44`](d66b79e) Thanks [@nishasy](https://github.com/nishasy)! - Change locked figures' initial color to grayH (previusly green) - [#1242](#1242) [`7d172698e`](7d17269) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Adds a warning above the protractor and ruler checkboxes in interactive-graph settings - [#1245](#1245) [`45a6647cf`](45a6647) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Fix location of DeviceFramer and ViewportResizer in Storybook - Updated dependencies \[[`44cf7348c`](44cf734), [`3c1e398d5`](3c1e398), [`ee89a1b01`](ee89a1b), [`54689a18f`](54689a1)]: - @khanacademy/perseus@22.4.0 ## @khanacademy/perseus-dev-ui@1.5.5 ### Patch Changes - [#1222](#1222) [`44cf7348c`](44cf734) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - ✨ Display image background info in Dev UI
Summary:
With our migration to Mafs, we still need to draw any
interactive-graph
backgrounds. But, when we do, it can become difficult to determine which UI elements are coming from the background and which are drawn by Mafs.This PR introduces a little "status" icon that, when hovered, shows the background image, if there is one. If it is a Graphie, it provides a link to view/edit the Graphie in the graphie-to-png editor.
Issue: "none"
Test plan:
yarn dev
Paste the following into the Flipbook:
Hover over the little icon below the <textarea> on the right side.
Paste the following into the Flipbook:
Note that the icon changes and it says the image is a "regular image" background.