Skip to content
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

Make Mafs line segment color offBlack64 #1073

Merged
merged 5 commits into from
Mar 14, 2024
Merged

Conversation

benchristel
Copy link
Member

@benchristel benchristel commented Mar 13, 2024

Summary:

We changed it (accidentally) to offBlack16 in
#1067. This commit fixes it.

Issue: none

Test plan:

View the Mafs segment graph in Storybook (http://localhost:6006/?path=/story/perseus-widgets-interactive-graph--segment-with-mafs-and-locked-points).
Verify that the segment is a darker gray than the gridlines.
Screen Shot 2024-03-13 at 6 11 27 PM

We changed it (accidentally) to offBlack16 in
#1067. This commit fixes it. I
removed the `--mafs-line-color` custom property because it's no longer
used.

Issue: none

Test plan:

View a Mafs segment graph in the dev UI (`yarn dev`). Verify that the
segment is a darker gray than the gridlines.
@benchristel benchristel self-assigned this Mar 13, 2024
@khan-actions-bot khan-actions-bot requested a review from a team March 13, 2024 23:26
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Mar 13, 2024

Gerald

Required Reviewers
  • @Khan/perseus for changes to .changeset/two-flowers-heal.md, packages/perseus/src/widgets/interactive-graphs/mafs-styles.css

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Copy link
Contributor

github-actions bot commented Mar 13, 2024

npm Snapshot: Published

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

Example:

yarn add @khanacademy/perseus@PR1073

If you are working in Khan Academy's webapp, you can run:

./dev/tools/bump_perseus_version.sh -t PR1073

@benchristel
Copy link
Member Author

benchristel commented Mar 13, 2024

I wonder if we should have visual snapshot tests to catch regressions like this 🤔

Though I don't think it would necessarily have caught this particular case—this regression happened because Nisha and I both changed the Mafs CSS concurrently in contradictory ways.

Copy link
Contributor

github-actions bot commented Mar 13, 2024

Size Change: 0 B

Total Size: 810 kB

ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38.1 kB
packages/kmath/dist/es/index.js 4.27 kB
packages/math-input/dist/es/index.js 80.4 kB
packages/perseus-core/dist/es/index.js 908 B
packages/perseus-editor/dist/es/index.js 263 kB
packages/perseus-error/dist/es/index.js 878 B
packages/perseus-linter/dist/es/index.js 21.8 kB
packages/perseus/dist/es/index.js 385 kB
packages/pure-markdown/dist/es/index.js 3.69 kB
packages/simple-markdown/dist/es/index.js 12.4 kB

compressed-size-action

Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.78%. Comparing base (eb637b3) to head (f4e3257).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1073      +/-   ##
==========================================
+ Coverage   67.42%   68.78%   +1.36%     
==========================================
  Files         436      438       +2     
  Lines       96523    96568      +45     
  Branches     6749    10293    +3544     
==========================================
+ Hits        65079    66424    +1345     
+ Misses      31444    30144    -1300     

Impacted file tree graph

see 97 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb637b3...f4e3257. Read the comment docs.

@nedredmond
Copy link
Contributor

The screenshot is a Graphie background, not a Mafs grid

@nedredmond
Copy link
Contributor

nedredmond commented Mar 13, 2024

@benchristel there's some confusion here-- the line segment color should use the "fg" variable, or foreground, not the "line-color" variable, which is for gridlines.

Please check a Mafs grid and ensure the gridlines are the appropriate color

Copy link
Contributor

@nedredmond nedredmond left a comment

Choose a reason for hiding this comment

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

Please verify that you are not causing a regression in the Mafs grid rendering

@@ -6,8 +6,6 @@
--mafs-bg: transparent;
--mafs-fg: rgb(33, 36, 44); /* WB color.offBlack */

--mafs-line-color: rgba(33, 36, 44, 0.16); /* WB color.offBlack16*/
Copy link
Contributor

Choose a reason for hiding this comment

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

@nishasy and I looked at this-- this variable is used for gridlines and needs to be offBlack16 or offBlack24

Copy link
Contributor

Choose a reason for hiding this comment

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

@nedredmond I ended up changing it back to offBlack16, because I looked and offBlack24 is not there in WB. 24% was only added for certain colors, not black. My mistake!

@@ -23,7 +21,7 @@
}

.MafsView .movable-segment {
--mafs-segment-stroke-color: var(--mafs-line-color);
Copy link
Contributor

Choose a reason for hiding this comment

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

This was the wrong variable for segment stroke, should have been fg (or you can make it offBlack64 like you did)

@nedredmond
Copy link
Contributor

I am getting the impression you mistakenly thought it was a Perseus-side custom variable. Unfortunately, Mafs doesn't have great documentation on the variables available. See its use here:

https://github.com/stevenpetryk/mafs/blob/main/src/display/Coordinates/Cartesian.tsx

Please restore it. Again, it's used to color gridlines.

@benchristel
Copy link
Member Author

@nedredmond Thanks, and good catch. I had a brain fart and thought --mafs-line-color was unused because searching for it showed no usages.

It's fixed now.

@nedredmond
Copy link
Contributor

@nedredmond Thanks, and good catch. I had a brain fart and thought --mafs-line-color was unused because searching for it showed no usages.

It's fixed now.

Great! Sorry for repeating myself a bunch i reviewed on the GitHub app and couldn't see my comments

@benchristel benchristel merged commit ea0db7d into main Mar 14, 2024
12 checks passed
@benchristel benchristel deleted the benc/fix-segment-color branch March 14, 2024 18:40
benchristel pushed a commit that referenced this pull request Mar 14, 2024
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-dev-ui@1.3.0

### Minor Changes

-   [#1071](#1071) [`eb637b35`](eb637b3) Thanks [@benchristel](https://github.com/benchristel)! - Add a "check answer" button to interactive graphs displayed in the dev flipbook UI

## @khanacademy/perseus@20.2.0

### Minor Changes

-   [#1067](#1067) [`6196375a`](6196375) Thanks [@nishasy](https://github.com/nishasy)! - Can pass a point into `lockedFigures` into MafsGraph and a point will be displayed.


-   [#1074](#1074) [`a263e940`](a263e94) Thanks [@nishasy](https://github.com/nishasy)! - Add "add a locked figure" UI to interactive graph editor + adding points (mafs graphs only)

### Patch Changes

-   [#1068](#1068) [`881da724`](881da72) Thanks [@benchristel](https://github.com/benchristel)! - Adjust styling of the movable points and line segments on the Mafs segment graph


-   [#1071](#1071) [`eb637b35`](eb637b3) Thanks [@benchristel](https://github.com/benchristel)! - Add a "check answer" button to interactive graphs displayed in the dev flipbook UI


-   [#1073](#1073) [`ea0db7d9`](ea0db7d) Thanks [@benchristel](https://github.com/benchristel)! - Fix color of Mafs line segments

## @khanacademy/perseus-editor@5.1.0

### Minor Changes

-   [#1074](#1074) [`a263e940`](a263e94) Thanks [@nishasy](https://github.com/nishasy)! - Add "add a locked figure" UI to interactive graph editor + adding points (mafs graphs only)

### Patch Changes

-   Updated dependencies \[[`881da724`](881da72), [`eb637b35`](eb637b3), [`6196375a`](6196375), [`a263e940`](a263e94), [`ea0db7d9`](ea0db7d)]:
    -   @khanacademy/perseus@20.2.0

Author: khan-actions-bot

Reviewers: benchristel

Required Reviewers:

Approved By: benchristel

Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage, ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ⏭️  Publish npm snapshot, ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Extract i18n strings (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ gerald, ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x)

Pull Request URL: #1069
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.

5 participants