Commit 71c51b8
authored
fix(web): keep the model quick-switch menu inside the viewport (#96)
## Related Issue
No issue. The problem is described below.
## Problem
The web model quick-switch menu opens above its pill with a fixed
`160px`
minimum height. When the pill sits near the top of the viewport, the
menu
reached past the viewport edge, so its upper entries could not be
scrolled to.
The existing test asserted the `160px` value, so it encoded the
off-screen
behaviour rather than catching it.
## What changed
Clamp the menu height to the space actually available above the pill.
The
`360px` cap is unchanged. The low-space case in the test now asserts the
constrained height.
This pull request was originally a larger desktop and web branch. #97
landed
that work, so only this fix is left; the branch has been reset onto
`main`.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [x] I have linked a related issue, or explained the problem above.
- [x] I have added tests that prove my feature works.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.1 parent 7dd68cb commit 71c51b8
3 files changed
Lines changed: 9 additions & 2 deletions
File tree
- .changeset
- apps/pythinker-web
- src/components
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
752 | | - | |
| 752 | + | |
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
411 | 413 | | |
412 | 414 | | |
413 | | - | |
| 415 | + | |
414 | 416 | | |
415 | 417 | | |
416 | 418 | | |
| |||
0 commit comments