Show the Kanban columns as a carousel on phones, enlarge time sheet text
Below lg the board's columns form a snapping carousel with a strip of the neighbouring columns on both sides, previous/next stage buttons and a "Vaihe 2/7" status. A card dragged to the carousel's edge turns it to the next column in that direction, and on while held there; Sortable's own auto-scroll stays on only on desktop. In the weekly time sheet the hour fields use a 14 px normal-weight font and customer names are text-sm instead of text-xs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -134,6 +134,38 @@ it('has no accessibility issues on the Kanban board and no sideways scrolling on
|
||||
'mobile, dark' => ['mobile', 'dark'],
|
||||
]);
|
||||
|
||||
it('shows the columns as a carousel on a phone, moved with the stage buttons', function () {
|
||||
visit(route('jobs.board'))
|
||||
->on()->mobile()
|
||||
->assertSee('Vaihe 1/')
|
||||
->click('Seuraava vaihe')
|
||||
->wait(1)
|
||||
->assertSee('Vaihe 2/')
|
||||
->assertScript('document.querySelector(".kanban-scroll").scrollLeft > 0', true)
|
||||
->assertScript('document.documentElement.scrollWidth <= window.innerWidth', true)
|
||||
->assertNoAccessibilityIssues(level: 2);
|
||||
});
|
||||
|
||||
it('turns the phone carousel towards the edge a card is dragged to', function () {
|
||||
$moveTo = fn (string $edge): string => '(() => { const box = document.querySelector(".kanban-scroll").getBoundingClientRect(); '
|
||||
.'document.dispatchEvent(new PointerEvent("pointermove", { clientX: '.['right' => 'box.right - 5', 'left' => 'box.left + 5', 'centre' => 'box.left + box.width / 2'][$edge].', clientY: box.top + 100 })); return true; })()';
|
||||
|
||||
visit(route('jobs.board'))
|
||||
->on()->mobile()
|
||||
->assertSee('Vaihe 1/')
|
||||
->assertScript('(() => { document.body.classList.add("sorting"); return true; })()', true)
|
||||
->assertScript($moveTo('right'), true)
|
||||
->wait(0.6)
|
||||
->assertScript($moveTo('centre'), true)
|
||||
->wait(0.6)
|
||||
->assertSee('Vaihe 2/')
|
||||
->assertScript($moveTo('left'), true)
|
||||
->wait(0.6)
|
||||
->assertScript($moveTo('centre'), true)
|
||||
->wait(0.6)
|
||||
->assertSee('Vaihe 1/');
|
||||
});
|
||||
|
||||
it('moves a card to another column with the keyboard through the job editor', function () {
|
||||
visit(route('jobs.board'))
|
||||
->assertScript('document.querySelector("#column-quotes").textContent.includes("Messuvideo")', true)
|
||||
|
||||
Reference in New Issue
Block a user