@samitouri / QOSami-HFS / commits / 2cb01b53

fix: (regression 3.1.0) frontend crash with % in filename

Massimo Melina committed May 14, 2026 at 00:20 UTC 2cb01b53dc44d874c3419f95c631377e534cdaf2
3 files changed +11 -3
e2e/frontend.spec.ts
+5 -1
@@ -151,7 +151,7 @@ test('search1', async ({ page }) => {
151 await page.getByRole('button', { name: 'Search' }).click()
152 await page.locator('input[name="name"]').fill('a*')
153 await page.locator('input[name="name"]').press('Enter')
154 - await page.getByText('files, 36 B').click()
154 + await page.getByText('files, 42 B').click()
155
156 await page.getByRole('link', { name: 'home' }).click()
157 await page.getByRole('button', { name: 'Close' }).click()
@@ -395,4 +395,8 @@ test('order field', async ({ page }) => {
395 await page.goto(FRONTEND_URL + 'renameChild/orderTest/')
396 await expect(page.getByText('orderTest')).toBeVisible()
397 await expect(page.locator('.entry-name')).toHaveText(['B', 'A', 'C'])
398 + await page.goto(FRONTEND_URL + 'renameChild/')
399 + await page.getByRole('link', { name: 'gui#%2, Folder' }).click()
400 + await expect(page.getByRole('link', { name: 'alfa.txt' })).toBeVisible()
401 + await expect(page.getByText('Not found')).not.toBeVisible()
402 })
frontend/src/router.ts
+2 -2
@@ -26,8 +26,8 @@ export function useNavigate() {
26 }
27
28 export function useLocation(): { pathname: string } {
29 - const [pathname] = useWouterLocation()
30 - return { pathname }
29 + useWouterLocation() // used just to cause render
30 + return { pathname: location.pathname }
31 }
32
33 type RouteProps = {
tests/config.yaml
+4
@@ -77,6 +77,10 @@ vfs:
77 rename:
78 alfa.txt: renamed1
79 page/gpl.png: renamed2
80 + - name: gui#%2
81 + can_see: true
82 + children:
83 + - source: ../alfa.txt
84 - name: orderTest
85 can_see: true
86 children: