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

Grid ruler marker labels #6664

Merged
merged 2 commits into from
Nov 21, 2024
Merged

Grid ruler marker labels #6664

merged 2 commits into from
Nov 21, 2024

Conversation

ruggi
Copy link
Contributor

@ruggi ruggi commented Nov 20, 2024

Problem:

Ruler markers should show a label with the respective CSS value when hovered.

Fix:

  1. Show labels with the printed pin CSS when hovering a ruler marker. For line names, show the line name. For named spans, show span the-area.
  2. Adjust the markers so they respect the verbatim CSS without special treatment for span-end/start (which we could revisit in the future)
  3. Adjust (and make more readable) the invididual marker skew values, which need to be customized in a bunch of combinations (it's subtle, but it's there!). I ended up using a bunch of named conditions, which after some tinkering felt much more readable than a cluster of ifs or switches. Better ideas are more than welcome tho! 🤗
Screen.Recording.2024-11-20.at.15.41.18.mov
Config Before After
gridColumn: auto, gridRow: auto Screenshot 2024-11-20 at 15 30 23 Screenshot 2024-11-20 at 15 30 20
gridColumn: 3, gridRow: 1 Screenshot 2024-11-20 at 15 30 36 Screenshot 2024-11-20 at 15 30 35
gridColumn: span 2 / 4, gridRow: span 3 Screenshot 2024-11-20 at 15 35 51 Screenshot 2024-11-20 at 15 35 50
Screenshot 2024-11-20 at 15 31 22 Screenshot 2024-11-20 at 15 31 27 Screenshot 2024-11-20 at 15 31 35

Manual Tests:
I hereby swear that:

  • I opened a hydrogen project and it loaded
  • I could navigate to various routes in Play mode

Fixes #6663

Copy link
Contributor

github-actions bot commented Nov 20, 2024

Try me

Copy link

relativeci bot commented Nov 20, 2024

#15242 Bundle Size — 58.1MiB (~+0.01%).

41c9911(current) vs d1d46c1 master#15230(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#15242
     Baseline
#15230
Regression  Initial JS 41.07MiB(~+0.01%) 41.07MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 18.45% 18.04%
No change  Chunks 20 20
No change  Assets 22 22
No change  Modules 4171 4171
No change  Duplicate Modules 213 213
No change  Duplicate Code 27.29% 27.29%
No change  Packages 477 477
No change  Duplicate Packages 70 70
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#15242
     Baseline
#15230
Regression  JS 58.09MiB (~+0.01%) 58.09MiB
Improvement  HTML 7.37KiB (-0.25%) 7.39KiB

Bundle analysis reportBranch feat/ruler-marker-labelsProject dashboard


Generated by RelativeCIDocumentationReport issue

@ruggi ruggi marked this pull request as ready for review November 20, 2024 15:07

// This function returns the amount of pixels used to adjust the position of
// individual ruler markers, which need specific skews based on their shape.
function skewMarkerPosition(
Copy link
Contributor

Choose a reason for hiding this comment

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

All the comments, love it.

@ruggi
Copy link
Contributor Author

ruggi commented Nov 21, 2024

put the markers behind a FF in 41c9911 (#6664) so we can experiment a bit more freely (cc @balazsbajorics @lankaukk )

@ruggi ruggi merged commit 80561fc into master Nov 21, 2024
14 checks passed
@ruggi ruggi deleted the feat/ruler-marker-labels branch November 21, 2024 11:46
liady pushed a commit that referenced this pull request Dec 13, 2024
**Problem:**

Ruler markers should show a label with the respective CSS value when
hovered.

**Fix:**

1. Show labels with the printed pin CSS when hovering a ruler marker.
For line names, show the line name. For named spans, show `span
the-area`.
2. Adjust the markers so they respect the verbatim CSS without special
treatment for span-end/start (which we could revisit in the future)
3. Adjust (and make more readable) the invididual marker skew values,
which need to be customized in a bunch of combinations (it's subtle, but
it's there!). I ended up using a bunch of named conditions, which after
some tinkering felt much more readable than a cluster of ifs or
switches. Better ideas are more than welcome tho! 🤗


https://github.com/user-attachments/assets/063adeb5-0b09-4a09-8603-77448bfd0cb2

| Config | Before | After |
|--------|---------|-----------|
| `gridColumn: auto`, `gridRow: auto` | <img width="1120"
alt="Screenshot 2024-11-20 at 15 30 23"
src="https://github.com/user-attachments/assets/c2d2b355-0312-46f4-a34c-f10f4619ddb8">
| <img width="1120" alt="Screenshot 2024-11-20 at 15 30 20"
src="https://github.com/user-attachments/assets/a733ca4c-1d77-4d26-925e-8ce4161a3989">
|
| `gridColumn: 3`, `gridRow: 1` | <img width="1120" alt="Screenshot
2024-11-20 at 15 30 36"
src="https://github.com/user-attachments/assets/b5365ca3-9d2b-4c26-ab32-1811bbf82cb4">
| <img width="1120" alt="Screenshot 2024-11-20 at 15 30 35"
src="https://github.com/user-attachments/assets/ae8a1a1c-67a5-466a-a46c-233f98553705">
|
| `gridColumn: span 2 / 4`, `gridRow: span 3` | <img width="1133"
alt="Screenshot 2024-11-20 at 15 35 51"
src="https://github.com/user-attachments/assets/dbb8d3e3-89ef-4262-90df-f222bb828c83">
| <img width="1133" alt="Screenshot 2024-11-20 at 15 35 50"
src="https://github.com/user-attachments/assets/018bd102-7331-4fbb-8ba6-8ab3316d4464">
|

<img width="1120" alt="Screenshot 2024-11-20 at 15 31 22"
src="https://github.com/user-attachments/assets/83057672-e2e5-4307-91ab-bd1a01e8a520">
<img width="1120" alt="Screenshot 2024-11-20 at 15 31 27"
src="https://github.com/user-attachments/assets/4bb71dab-d3d6-46e7-b6ec-6e10a726ae7e">
<img width="1133" alt="Screenshot 2024-11-20 at 15 31 35"
src="https://github.com/user-attachments/assets/453040c3-7151-4ff8-bfc8-73ed9925307b">






**Manual Tests:**
I hereby swear that:

- [x] I opened a hydrogen project and it loaded
- [x] I could navigate to various routes in Play mode

Fixes #6663
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.

ruler marker labels
3 participants