Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions frontend/src/views/DashboardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,11 @@ onUnmounted(() => {

<!-- Edit mode: same grid with draggable card-slot wrappers -->
<template v-if="editMode">
<!-- Tyre diagram + location map: shown or hidden, and swapped with each other only -->
<!-- Tyre diagram + location map: shown or hidden, and swapped with each other only. Spaced
like the row outside edit mode, so no card moves when editing starts. -->
<EditableCardGrid
v-model="settings.overview"
class="overview-row mt-4 mb-4"
class="overview-row mb-4"
:slot-class="(part) => `card-slot--large ${OVERVIEW_PARTS[part.id].className}`"
@toggle-visible="(part) => settings.toggleOverview(part.id)"
>
Expand Down
22 changes: 22 additions & 0 deletions frontend/src/views/__tests__/DashboardView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,28 @@ describe('DashboardView', () => {
expect(overview.find('.card').exists()).toBe(false)
})

// Edit mode gave the row a top margin of its own, so every card dropped as editing began.
it('keeps the overview row spaced the same while editing, so no card moves', async () => {
const wrapper = await mountView()
const spacing = () =>
wrapper
.get('.overview-row')
.classes()
.filter((name) => /^m[tb]-/.test(name))
.sort()
const before = spacing()

await wrapper
.findAll('button')
.find((b) => b.text() === en.dashboard.editLayout)!
.trigger('click')
await vi.dynamicImportSettled()
await flushPromises()

expect(wrapper.get('.overview-row').classes()).toContain('card-grid')
expect(spacing()).toEqual(before)
})

// Issue #570: a card the car sends nothing for showed as a placeholder while editing and then
// vanished on Done, with nothing saying why.
it('says while editing which shown cards stay hidden until the car reports them', async () => {
Expand Down
Loading