Compare commits

...

2 Commits

Author SHA1 Message Date
kolaente 9c13e674d1 fix(test): update mobile kanban test to use close button instead of back button
The back button was removed from modal mode in the previous commit.
On mobile kanban, tasks open as modals, so the test now uses the
close button from the Heading component instead.
2026-03-03 15:40:49 +01:00
Claude 768b29e83c fix: remove duplicate close button on mobile task detail view
When viewing a task in modal mode on mobile, both a back button and a close button were displayed, causing confusion. The back button condition `!isModal || isMobile` meant it would show on mobile even in modal mode.

This fix changes the back button to only display when not in modal mode (`!isModal`), ensuring only the close button appears when viewing tasks in a modal on mobile devices.

Also removed the now-unused `isMobile` variable and its import.
2026-03-03 13:31:06 +01:00
2 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@
class="task-view"
>
<BaseButton
v-if="!isModal || isMobile"
v-if="!isModal"
class="back-button mbs-2"
@click="lastProject ? router.back() : router.push(projectRoute)"
>
@ -617,7 +617,7 @@ import {ref, reactive, shallowReactive, computed, watch, nextTick, onMounted} fr
import {useRouter, useRoute, type RouteLocation, onBeforeRouteLeave} from 'vue-router'
import {storeToRefs} from 'pinia'
import {useI18n} from 'vue-i18n'
import {unrefElement, useDebounceFn, useElementSize, useIntersectionObserver, useMediaQuery, useMutationObserver} from '@vueuse/core'
import {unrefElement, useDebounceFn, useElementSize, useIntersectionObserver, useMutationObserver} from '@vueuse/core'
import {klona} from 'klona/lite'
import TaskService from '@/services/task'
@ -781,7 +781,6 @@ const color = computed(() => {
})
const isModal = computed(() => Boolean(props.backdropView))
const isMobile = useMediaQuery('(max-width: 1024px)')
function attachmentUpload(file: File, onSuccess?: (url: string) => void) {
return uploadFile(props.taskId, file, onSuccess)

View File

@ -217,7 +217,7 @@ test.describe('Task', () => {
await expect(page).toHaveURL(/\/projects\/1\/\d+/)
})
test('provides back navigation to the project in the kanban view on mobile', async ({authenticatedPage: page}) => {
test('provides close navigation to the project in the kanban view on mobile', async ({authenticatedPage: page}) => {
await page.setViewportSize({width: 375, height: 667}) // iphone-8
const tasks = await TaskFactory.create(1, {
@ -237,8 +237,9 @@ test.describe('Task', () => {
const taskLocator = page.locator('.kanban-view .tasks .task').first()
await expect(taskLocator).toBeVisible({timeout: 10000})
await taskLocator.click()
await expect(page.locator('.task-view .back-button')).toBeVisible()
await page.locator('.task-view .back-button').click()
// On mobile, the task opens as a modal with a close button instead of a back button
await expect(page.locator('.task-view .task-properties .close')).toBeVisible()
await page.locator('.task-view .task-properties .close').click()
await expect(page).toHaveURL(/\/projects\/\d+\/\d+/)
})