Commit 8d6c2ac
authored
fix(processing): make the Whitebox toolbox usable on a narrow panel (#1917)
* fix(processing): make the Whitebox toolbox usable on a narrow panel
The panel's split was `grid-cols-[minmax(260px,320px)_minmax(0,1fr)]`.
That 260px is a hard floor, so once the panel dropped under about 570px
the tool list kept its 260px and the parameter form was left roughly
120px. Everything in the form then overflowed the panel: a label wrapped
to one word per line, its input ran off the right edge, and the run-local
toggle collided with the tool name. At a 482px viewport 24 elements laid
out past the viewport; at 390px, 40.
Breakpoints are container queries against the panel, not `sm:`/`md:`. The
panel is draggable and resizable, and `style.width` overrides its width
class, so a viewport media query would hold the two-column layout after
the user dragged the panel down to 400px on a desktop -- the same squeeze,
without a narrow viewport to signal it.
- Split stacks into two equal, independently scrolling rows below @XL,
and the divider follows the axis (bottom rule stacked, end rule
side by side).
- The tool-name row wraps, so the toggle and the two buttons drop to
their own line. The name asks for 12rem so that wrap actually fires:
with `flex-1` its basis is 0 and it shrank to "Build..." to keep
everything on one line. The toggle no longer wraps to a three-line
stack.
- The three picker rows with a 150px label column stack below @sm,
measured against the form rather than the panel, since the form is full
width once the layout stacks.
- Category and source filters share a row while stacked, so the two
filters cost one row of height instead of two. Flex, not a 2-col grid,
so category still fills the row when the source filter is absent.
- The tool list's ScrollArea gets `[&>div>div]:!block`. Radix ships that
wrapper as `display: table; min-width: 100%`, which sizes to content, so
the rows' `truncate` never engaged. Local, not in the shared primitive:
129 call sites use ScrollArea and some want the content-sized,
horizontally scrollable behaviour.
Measured on the built app, counting elements laid out past the viewport,
with a tool selected:
482px 24 -> 0 390px 40 -> 0 320px many -> 0
768px 0 -> 0 1024px 0 -> 0 1440px 0 -> 0
Desktop is not untouched, but the two differences are both fixes the
ScrollArea change brought with it: the tool list no longer shows a
spurious horizontal scrollbar, and its last row is no longer clipped by
it. Checked at 1024px and 1440px in light and dark.
* Address review feedback
- LayerOrPathInput: give the layer picker `col-span-2
@sm/params:col-span-1`. The row has three children but the narrow
template I added has only two columns, so grid auto-placement put the
picker in column 1, squeezed the path Input into the 2.25rem
browse-button track, and wrapped the button onto a row of its own.
Measured with a probe carrying the production classes, at a 300px
container: before, input 36px and button 256px on row 2; after, picker
300px on row 1 with input 256px and button 36px sharing row 2. At 500px
all three sit on one row as before. The other two converted rows stack
to a single column, where any child count is fine, so only this one
needed it. (Claude review, CodeRabbit - same finding)
My own check for this PR counted elements laid out past the viewport,
which this could never trip: nothing overflowed, it was just squeezed
into the wrong track. Both bots were right to flag it.
* Address review feedback
- ScrollArea override: move the important modifier to the trailing
position, `[&>div>div]:block!`. This is Tailwind v4's syntax and matches
the same Radix ScrollArea override already in LayerPanel.tsx, so the two
now read alike.
The premise that it might not have been compiling was not the case: the
leading form generated
`.\[\&\>div\>div\]\:\!block>div>div{display:block!important}` in the
built stylesheet, v4 still accepting the v3 spelling, which is why the
truncation fix did take effect and showed up in the pixel diff against
main. Switched anyway, for the consistency reason rather than the
correctness one - the legacy spelling is deprecated and could be dropped.
Re-checked the built app after the change: the wrapper computes
`display: block` and matches its viewport width exactly (301px at
1440px, 327px at 390px), the list has no horizontal scrollbar, and
nothing escapes the viewport. (Claude review)1 parent 80af16e commit 8d6c2ac
1 file changed
Lines changed: 106 additions & 39 deletions
Lines changed: 106 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1630 | 1630 | | |
1631 | 1631 | | |
1632 | 1632 | | |
1633 | | - | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
1634 | 1641 | | |
1635 | 1642 | | |
1636 | 1643 | | |
| |||
1701 | 1708 | | |
1702 | 1709 | | |
1703 | 1710 | | |
1704 | | - | |
1705 | | - | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
1706 | 1722 | | |
1707 | 1723 | | |
1708 | 1724 | | |
| |||
1756 | 1772 | | |
1757 | 1773 | | |
1758 | 1774 | | |
1759 | | - | |
1760 | | - | |
1761 | | - | |
1762 | | - | |
1763 | | - | |
1764 | | - | |
1765 | | - | |
1766 | | - | |
1767 | | - | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
1768 | 1782 | | |
1769 | | - | |
1770 | | - | |
1771 | | - | |
1772 | | - | |
1773 | | - | |
1774 | | - | |
1775 | | - | |
1776 | | - | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
1777 | 1786 | | |
1778 | | - | |
1779 | | - | |
1780 | | - | |
1781 | | - | |
1782 | | - | |
1783 | | - | |
1784 | | - | |
1785 | | - | |
1786 | | - | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
1787 | 1792 | | |
1788 | | - | |
1789 | 1793 | | |
1790 | | - | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
1791 | 1833 | | |
1792 | 1834 | | |
1793 | 1835 | | |
| |||
1827 | 1869 | | |
1828 | 1870 | | |
1829 | 1871 | | |
1830 | | - | |
1831 | | - | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
1832 | 1882 | | |
1833 | 1883 | | |
1834 | 1884 | | |
| |||
1841 | 1891 | | |
1842 | 1892 | | |
1843 | 1893 | | |
1844 | | - | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
1845 | 1898 | | |
1846 | 1899 | | |
1847 | 1900 | | |
| |||
1896 | 1949 | | |
1897 | 1950 | | |
1898 | 1951 | | |
1899 | | - | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
1900 | 1957 | | |
1901 | 1958 | | |
1902 | 1959 | | |
| |||
2329 | 2386 | | |
2330 | 2387 | | |
2331 | 2388 | | |
2332 | | - | |
| 2389 | + | |
2333 | 2390 | | |
2334 | 2391 | | |
2335 | 2392 | | |
| |||
2388 | 2445 | | |
2389 | 2446 | | |
2390 | 2447 | | |
2391 | | - | |
| 2448 | + | |
2392 | 2449 | | |
2393 | 2450 | | |
2394 | 2451 | | |
| |||
2690 | 2747 | | |
2691 | 2748 | | |
2692 | 2749 | | |
2693 | | - | |
2694 | | - | |
| 2750 | + | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
2695 | 2762 | | |
2696 | 2763 | | |
2697 | 2764 | | |
| |||
0 commit comments