mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
v10.48
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a5246fbf57 |
Mobile mode: drag-scroll the header bars, hamburger in the corner, full-width lists.
Four things reported while using mobile mode, three of them in the second header
bar.
Drag-to-scroll now works on BOTH top header bars, not only below them. Everywhere
else a drag scrolls - `.board-canvas.dragscroll` on a board, `<body>` / `#content`
on the whole-page layouts - but the two header bars were dead, and on a phone they
are a large share of what is on screen. They cannot simply be tagged `.dragscroll`:
that class scrolls the element carrying it, and neither bar is a scroll container -
`#header` sits outside `#content` and outside the board canvas. So a new module,
client/lib/headerDragscroll.js, forwards the drag to whatever actually scrolls: a
scroller inside the header first (the starred-boards list is overflow-x:auto), then
the board canvas, then the page scroller. Both bars are `.nodragscroll` so the
page-level dragscroll does not scroll a second time from the same gesture. Mouse and
touch are both handled - a phone sends no mouse events, and the dragscroll library is
mouse-only and element-bound. A tap is still a tap: scrolling starts only past a 4px
threshold, and only then is the click that ends the gesture swallowed, in the capture
phase, so dragging across the bar does not press whatever you let go over.
The second header bar on a phone now reads title, buttons, hamburger. The board title
is shown again - it was hidden by a `display: none !important` that predates this
work, which left the bar with nothing but icons, so you could not tell which board you
were on. A board name is how you know where you are, so it wraps rather than
truncating. The buttons start at the right of the title and drop to a second row as a
block when the space between the title and the menu button runs out; they are one flex
item, so they never split across the two rows.
The sidebar hamburger, with its divider to its left, is pinned in the TOP RIGHT
corner. It was lifted out of the `.right` group into its own flex item placed after
the title, because inside that group it could only ever wrap down together with the
other buttons - a flex line breaks in order. On a phone it is taken out of the flow
(position:absolute) and the bar reserves its width as end padding, so a long title or
a full row of buttons never runs underneath it; that reservation is board-only, since
the same bar on All Boards has no hamburger. On a wide screen `order: 1` puts it back
at the end of the bar, visually identical to before.
Lists and cards are full width in mobile mode on a DESKTOP browser too, not only on a
phone. Two causes, both from mobile mode being decided in two places that disagreed:
* Utils.isMiniScreen(), which drives the `mobile-view` class on each list, swimlane
and minicard, looked only at screen width and user agent. The explicit toggle was
honoured on iPhone only - and even there through a test that could never be false,
since getMobileMode() falls back to viewport detection and so always returns a
boolean. An explicit choice now wins on every device, via a new
getExplicitMobileMode() that can answer "never chosen"; the per-device branches
below it are the defaults for that case.
* `.mobile-mode .list { width: 100% !important }` was outranked by
`.js-swimlane .list[style*="--list-width"] { width: var(--list-width) !important }`
- both !important, and the second more specific. It never showed on a phone (no
inline --list-width is emitted there), only in mobile mode on a desktop window.
The override repeats those three selectors prefixed with body.mobile-mode, and
keeps the :not(.list-collapsed) exclusion so a collapsed list stays 30px (#5892).
Also adds tests/jadeCompiles.test.cjs, which compiles every .jade with the SAME
compiler the build uses. Nothing else caught a broken template: the other suites read
.jade as text and grep it, so a file the compiler rejects still passes them all. It
was written after a `<body>` inside an indented `//-` comment block broke the build
here - the comment text is still lexed, so the angle brackets opened a tag that never
closed. All 107 templates parse in ~0.2s.
tests/headerHamburger.test.cjs asserted the hamburger sits inside the `.right` group,
which is exactly what moved; it now checks the new wrapper, its divider, and that
`order` still puts it last on a wide screen.
Tests: 1309 passing.
Thanks to xet7 !
|
||
|
|
53c8fa19ee |
Mobile mode: show the board title again, on its own row above the buttons.
The second header bar in mobile mode had nothing but icons - you could not tell
which board you were on. The title was hidden by
/* Hide the board title in mobile mode to match mobile view */
.mobile-mode .header-board-menu { display: none !important; }
which predates this work; it was not lost in the recent header changes, the markup
still rendered it.
It fits now, and on two rows by design: the title takes the WHOLE first row and the
button group - one flex item since the earlier header change - wraps to the second
row entire. Sharing one row would squeeze the title down to a few characters, which
is presumably why hiding it looked like the lesser evil before.
A long board name wraps rather than truncating: the name is how you know where you
are, so it is worth the extra line.
The rest of what is absent from that bar on a phone is unrelated and unchanged:
edit / visibility / watch / star / sort are not rendered at all under
`unless isMiniScreen`, and reappear as icon-only buttons in the right group.
Tests: the title must not be hidden by any rule, it takes a full row and wraps,
the button group takes the second row, and the two rules stay in row order. The
suite reads boardHeader.css for these - the mobile rules live there, not in the
header.css it otherwise reads.
Thanks to xet7 !
|
||
|
|
23bcb83c8d |
Fix the two open CodeQL js/incomplete-sanitization alerts (#427, #428).
Both are in test helpers, so neither is reachable by an attacker, but both are genuinely wrong string handling and CodeQL rates the rule High. Alert #428, tests/boardHeaderOneLine.test.cjs: the rule bodies were split with `rule.split('{')` and the trailing brace removed with `body.replace('}', '')`, which strips only the FIRST '}'. The block is now matched with a single regex that captures selector and body as separate groups, so no brace ever ends up in the text and there is nothing to strip. Verified the check still catches a non-margin declaration in a button rule, and still ignores the h1's padding. Alert #427, tests/testsAreRegistered.test.cjs: a file name was spliced into a RegExp after escaping only dots (`stem.replace(/\./g, '\\.')`), leaving every other metacharacter - the backslash above all - able to change the meaning of the pattern. It now goes through an escapeRegExp() that escapes the full set including the backslash itself. Thanks to GitHub CodeQL (code scanning alerts #427 and #428) and xet7 ! |
||
|
|
9df568c0c2 |
Board bar: a long board title moves ALL the buttons to the second row.
On iPad landscape with a long board title, the controls were split across both rows: the title kept the left group (edit, visibility, watch, star, sort) beside it and only the right group (Filter / Search / view / dependencies / multi-selection / hamburger) wrapped underneath. That is what separate flex items do. The title, the left group, the centre group and the right group were four children of the #header-main-bar flex row, so the row filled with as many of them as fit and broke wherever it ran out - between the left and the right group. The three button groups now live inside ONE wrapper, .board-header-btns-group, so the row has just two items: the title and the buttons. Either the buttons fit beside the title or the whole set moves down together, under the title, which is what the report asked for. A short title is unaffected: the wrapper's flex-basis is auto, so it measures as its content width and only moves down when it genuinely does not fit - title and buttons still share one line exactly as before. The wrapper keeps flex-wrap: wrap so the groups can still break among themselves at widths where even the buttons alone do not fit. The h1 gains min-width: 0 / max-width: 100% / overflow-wrap so a title longer than the whole bar wraps inside the title instead of overflowing the viewport (a flex item cannot shrink below min-content without min-width: 0). The template change is a re-indent: every content line is unchanged, only its indentation, plus the new wrapper and its comment. exportHTML.js removed '#header-main-bar .board-header-btns' when exporting a board to HTML; it now removes the wrapper as well, so the export is not left with an empty div where the buttons were. Tests: tests/boardHeaderOneLine.test.cjs gains checks that all three groups are nested INSIDE the wrapper (by indentation, since sibling groups are exactly the bug), that the title stays a sibling of the wrapper so the row can break between them, that the wrapper's flex-basis stays auto (with `flex: 1 1 0` it would measure as zero width, never move down, and the split would come back), that the h1 can shrink and wrap, and that the export still strips the whole button area. Thanks to xet7 ! |
||
|
|
f75b28cc81 |
Board bar on iPad: fit the second header bar on one line.
On iPad landscape the board bar wrapped onto two rows: board title, edit, visibility, watch, star and sort on the first, Filter / Search / view / dependencies / multi-selection / hamburger on the second. Measured from the report at a 1180 CSS px viewport, the two rows needed ~613px + ~691px = ~1304px on one line, about 124px more than the viewport. Nearly all of that is per-button CHROME rather than text: every .board-header-btn carries 12px side margins (24px), its icon another 10px per side (20px) and a 10px gap after the label - roughly 54px of empty space around a ~60px icon+label. So nothing has to be hidden at this width; halving the chrome between 801px and 1400px frees ~295px, which fits the bar on one line at 1180px with room to spare for languages whose labels are longer than the Finnish ones. Only empty space shrinks - icon and label sizes are untouched, so the buttons stay comfortable to tap. Tablet PORTRAIT (iPad 820px) cannot fit ~1009px of icons+labels even halved, so between 801px and 1000px the labels drop to icons only, the same treatment the phone block already gives below 801px. Titles, tooltips and popups are unchanged, so nothing becomes unreachable. Bounded at 1400px so wide desktops, which never wrapped, look exactly as before; 1400px still covers iPad Pro 12.9" landscape (1366px), and phones at 800px and below keep their existing 44px touch targets. Tests: tests/boardHeaderOneLine.test.cjs guards the arithmetic, not just the presence of the rules - it reads the base and override margins out of header.css and asserts the halving frees more than the measured 124px deficit (with 2x slack for longer translations), that button rules in the tablet block change only margins so the #6419 touch sizing cannot be shrunk back, that the phone block is untouched, that the overrides come after the base rules they override (a media query adds no specificity, so source order decides), and that every control on the bar is a .board-header-btn so the rules actually reach it. Thanks to xet7 ! |