♻️ bump non-react deps in desktop-client (#5858)

* patch/minor deps

* @vitejs/plugin-basic-ssl 2.1.0

* remove chokidar

* cross-env 10.1.0

* downshift 9.0.10

* remove focus-visible

* jsdom 27.0.0

* rollup-plugin-visualizer 6.0.4

* note
This commit is contained in:
Matt Fiddaman
2025-10-06 16:28:04 +01:00
committed by GitHub
parent 4c5be62f56
commit 499f24f7fd
16 changed files with 524 additions and 444 deletions

View File

@@ -32,7 +32,7 @@ jobs:
needs: netlify
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.52.0-jammy
image: mcr.microsoft.com/playwright:v1.55.1-jammy
steps:
- uses: actions/checkout@v4
- name: Set up environment
@@ -53,7 +53,7 @@ jobs:
name: Functional Desktop App
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.52.0-jammy
image: mcr.microsoft.com/playwright:v1.55.1-jammy
steps:
- uses: actions/checkout@v4
- name: Set up environment
@@ -74,7 +74,7 @@ jobs:
needs: netlify
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.52.0-jammy
image: mcr.microsoft.com/playwright:v1.55.1-jammy
steps:
- uses: actions/checkout@v4
- name: Set up environment

View File

@@ -19,7 +19,7 @@ jobs:
github.event.issue.pull_request &&
contains(github.event.comment.body, '/update-vrt')
container:
image: mcr.microsoft.com/playwright:v1.52.0-jammy
image: mcr.microsoft.com/playwright:v1.55.1-jammy
steps:
- name: Get PR branch
# Until https://github.com/xt0rted/pull-request-comment-branch/issues/322 is resolved we use the forked version

View File

@@ -28,5 +28,5 @@ echo "Running VRT tests with the following parameters:"
echo "E2E_START_URL: $E2E_START_URL"
echo "VRT_ARGS: $VRT_ARGS"
MSYS_NO_PATHCONV=1 docker run --rm --network host -v "$(pwd)":/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.52.0-jammy /bin/bash \
MSYS_NO_PATHCONV=1 docker run --rm --network host -v "$(pwd)":/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.55.1-jammy /bin/bash \
-c "E2E_START_URL=$E2E_START_URL yarn vrt $VRT_ARGS"

View File

@@ -59,7 +59,7 @@
"@types/node": "^22.17.0",
"@types/prompts": "^2.4.9",
"@typescript-eslint/parser": "^8.45.0",
"cross-env": "^7.0.3",
"cross-env": "^10.1.0",
"eslint": "^9.36.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",

View File

@@ -65,10 +65,10 @@ Run manually:
```sh
# Run docker container
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.52.0-jammy /bin/bash
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.55.1-jammy /bin/bash
# If you receive an error such as "docker: invalid reference format", please instead use the following command:
docker run --rm --network host -v ${pwd}:/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.52.0-jammy /bin/bash
docker run --rm --network host -v ${pwd}:/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.55.1-jammy /bin/bash
# Once inside the docker container, run the VRT tests: important - they MUST be ran against a HTTPS server.
# Use the ip and port noted earlier

View File

@@ -108,10 +108,6 @@
min-height: 0;
min-width: 0;
}
.js-focus-visible :focus:not(.focus-visible) {
outline: 0;
}
</style>
</head>
<body>

View File

@@ -8,14 +8,14 @@
"devDependencies": {
"@actual-app/components": "workspace:*",
"@emotion/css": "^11.13.5",
"@fontsource/redacted-script": "^5.2.5",
"@fontsource/redacted-script": "^5.2.8",
"@juggle/resize-observer": "^3.4.0",
"@playwright/test": "1.52.0",
"@playwright/test": "1.55.1",
"@rollup/plugin-inject": "^5.0.5",
"@swc/core": "^1.11.24",
"@swc/core": "^1.13.5",
"@swc/helpers": "^0.5.17",
"@testing-library/dom": "10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/dom": "10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "16.3.0",
"@testing-library/user-event": "14.6.1",
"@types/lodash": "^4",
@@ -25,21 +25,19 @@
"@types/react-grid-layout": "^1",
"@types/react-modal": "^3.16.3",
"@use-gesture/react": "^10.3.1",
"@vitejs/plugin-basic-ssl": "^1.2.0",
"@vitejs/plugin-react": "^5.0.2",
"@vitejs/plugin-basic-ssl": "^2.1.0",
"@vitejs/plugin-react": "^5.0.4",
"auto-text-size": "^0.2.3",
"babel-plugin-react-compiler": "19.1.0-rc.3",
"chokidar": "^3.6.0",
"cmdk": "^1.1.1",
"cross-env": "^7.0.3",
"cross-env": "^10.1.0",
"date-fns": "^4.1.0",
"downshift": "7.6.2",
"focus-visible": "^4.1.5",
"i18next": "^25.2.1",
"downshift": "9.0.10",
"i18next": "^25.5.3",
"i18next-parser": "^9.3.0",
"i18next-resources-to-backend": "^1.2.1",
"inter-ui": "^3.19.3",
"jsdom": "^26.1.0",
"jsdom": "^27.0.0",
"lodash": "^4.17.21",
"loot-core": "workspace:*",
"mdast-util-newline-to-break": "^2.0.0",
@@ -70,12 +68,12 @@
"recharts": "^2.15.3",
"rehype-external-links": "^3.0.0",
"remark-gfm": "^4.0.1",
"rollup-plugin-visualizer": "^5.14.0",
"sass": "^1.89.0",
"rollup-plugin-visualizer": "^6.0.4",
"sass": "^1.93.2",
"usehooks-ts": "^3.1.1",
"uuid": "^13.0.0",
"vite": "^6.3.6",
"vite-plugin-pwa": "^1.0.0",
"vite-plugin-pwa": "^1.0.3",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^3.2.4",
"xml2js": "^0.6.2"

View File

@@ -473,115 +473,127 @@ function SingleAutocomplete<T extends AutocompleteItem>({
>
<View ref={triggerRef} style={{ flexShrink: 0 }}>
{renderInput(
getInputProps({
ref: inputRef,
...inputProps,
onFocus: e => {
inputProps.onFocus?.(e);
(() => {
const { className, style, ...restInputProps } =
inputProps || {};
const downshiftProps = getInputProps({
ref: inputRef,
...restInputProps,
onFocus: e => {
inputProps.onFocus?.(e);
if (openOnFocus) {
open();
}
},
onBlur: e => {
// Should this be e.nativeEvent
e['preventDownshiftDefault'] = true;
inputProps.onBlur?.(e);
if (openOnFocus) {
open();
}
},
onBlur: e => {
// Should this be e.nativeEvent
e['preventDownshiftDefault'] = true;
inputProps.onBlur?.(e);
if (!closeOnBlur) {
return;
}
if (itemsViewRef.current?.contains(e.relatedTarget)) {
// Do not close when the user clicks on any of the items.
e.stopPropagation();
return;
}
if (clearOnBlur) {
if (e.target.value === '') {
onSelect?.(null, e.target.value);
setSelectedItem(null);
close();
if (!closeOnBlur) {
return;
}
// If not using table behavior, reset the input on blur. Tables
// handle saving the value on blur.
const value = selectedItem ? getItemId(selectedItem) : null;
resetState(value);
} else {
close();
}
},
onKeyDown: (e: KeyboardEvent<HTMLInputElement>) => {
const { onKeyDown } = inputProps || {};
// If the dropdown is open, an item is highlighted, and the user
// pressed enter, always capture that and handle it ourselves
if (isOpen) {
if (e.key === 'Enter') {
if (highlightedIndex != null) {
if (
inst.lastChangeType ===
Downshift.stateChangeTypes.itemMouseEnter
) {
// If the last thing the user did was hover an item, intentionally
// ignore the default behavior of selecting the item. It's too
// common to accidentally hover an item and then save it
e.preventDefault();
} else {
// Otherwise, stop propagation so that the table navigator
// doesn't handle it
e.stopPropagation();
}
} else if (!strict) {
// Handle it ourselves
e.stopPropagation();
onSelect(value, (e.target as HTMLInputElement).value);
return onSelectAfter();
} else {
// No highlighted item, still allow the table to save the item
// as `null`, even though we're allowing the table to move
e.preventDefault();
onKeyDown?.(e);
}
} else if (shouldSaveFromKey(e)) {
e.preventDefault();
onKeyDown?.(e);
}
}
// Handle escape ourselves
if (e.key === 'Escape') {
e.nativeEvent['preventDownshiftDefault'] = true;
if (!embedded) {
if (itemsViewRef.current?.contains(e.relatedTarget)) {
// Do not close when the user clicks on any of the items.
e.stopPropagation();
return;
}
fireUpdate(
onUpdate,
strict,
suggestions,
null,
getItemId(originalItem),
);
if (clearOnBlur) {
if (e.target.value === '') {
onSelect?.(null, e.target.value);
setSelectedItem(null);
close();
return;
}
setValue(getItemName(originalItem));
setSelectedItem(
findItem(strict, suggestions, originalItem),
);
setHighlightedIndex(null);
if (embedded) {
open();
// If not using table behavior, reset the input on blur. Tables
// handle saving the value on blur.
const value = selectedItem
? getItemId(selectedItem)
: null;
resetState(value);
} else {
close();
}
}
},
}),
},
onKeyDown: (e: KeyboardEvent<HTMLInputElement>) => {
const { onKeyDown } = inputProps || {};
// If the dropdown is open, an item is highlighted, and the user
// pressed enter, always capture that and handle it ourselves
if (isOpen) {
if (e.key === 'Enter') {
if (highlightedIndex != null) {
if (
inst.lastChangeType ===
Downshift.stateChangeTypes.itemMouseEnter
) {
// If the last thing the user did was hover an item, intentionally
// ignore the default behavior of selecting the item. It's too
// common to accidentally hover an item and then save it
e.preventDefault();
} else {
// Otherwise, stop propagation so that the table navigator
// doesn't handle it
e.stopPropagation();
}
} else if (!strict) {
// Handle it ourselves
e.stopPropagation();
onSelect(value, (e.target as HTMLInputElement).value);
return onSelectAfter();
} else {
// No highlighted item, still allow the table to save the item
// as `null`, even though we're allowing the table to move
e.preventDefault();
onKeyDown?.(e);
}
} else if (shouldSaveFromKey(e)) {
e.preventDefault();
onKeyDown?.(e);
}
}
// Handle escape ourselves
if (e.key === 'Escape') {
e.nativeEvent['preventDownshiftDefault'] = true;
if (!embedded) {
e.stopPropagation();
}
fireUpdate(
onUpdate,
strict,
suggestions,
null,
getItemId(originalItem),
);
setValue(getItemName(originalItem));
setSelectedItem(
findItem(strict, suggestions, originalItem),
);
setHighlightedIndex(null);
if (embedded) {
open();
} else {
close();
}
}
},
});
return {
...downshiftProps,
...(className && { className }),
...(style && { style }),
};
})(),
)}
</View>
{isOpen &&

View File

@@ -44,11 +44,25 @@ function makePayee(name: string, options?: { favorite: boolean }): PayeeEntity {
}
function extractPayeesAndHeaderNames(screen: Screen) {
return [
...screen
.getByTestId('autocomplete')
.querySelectorAll(`${PAYEE_SELECTOR}, ${PAYEE_SECTION_SELECTOR}`),
]
const autocompleteElement = screen.getByTestId('autocomplete');
// Get all elements that match either selector, but query them separately
// and then sort by their position in the DOM to maintain document order
const headers = [
...autocompleteElement.querySelectorAll(PAYEE_SECTION_SELECTOR),
];
const items = [...autocompleteElement.querySelectorAll(PAYEE_SELECTOR)];
// Combine all elements and sort by their position in the DOM
const allElements = [...headers, ...items];
allElements.sort((a, b) => {
// Compare document position to maintain DOM order
return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING
? -1
: 1;
});
return allElements
.map(e => e.getAttribute('data-testid'))
.map(firstOrIncorrect);
}
@@ -154,15 +168,9 @@ describe('PayeeAutocomplete.getPayeeSuggestions', () => {
];
await clickAutocomplete(renderPayeeAutocomplete({ payees }));
expect(
[
...screen
.getByTestId('autocomplete')
.querySelectorAll(`${PAYEE_SELECTOR}, ${PAYEE_SECTION_SELECTOR}`),
]
.map(e => e.getAttribute('data-testid'))
.map(firstOrIncorrect),
).toStrictEqual(expectedPayeeOrder);
expect(extractPayeesAndHeaderNames(screen)).toStrictEqual(
expectedPayeeOrder,
);
});
test('list with more than the maximum favorites only lists favorites', async () => {

View File

@@ -137,7 +137,7 @@ export const Checkbox = (props: CheckboxProps) => {
backgroundColor: theme.buttonNormalDisabledBorder,
},
},
'&.focus-visible:focus': {
'&:focus-visible': {
'::before': {
position: 'absolute',
top: -5,

View File

@@ -21,9 +21,6 @@ import * as appSlice from './app/appSlice';
import { AuthProvider } from './auth/AuthProvider';
import * as budgetSlice from './budget/budgetSlice';
import * as budgetfilesSlice from './budgetfiles/budgetfilesSlice';
// See https://github.com/WICG/focus-visible. Only makes the blue
// focus outline appear from keyboard events.
import 'focus-visible';
import { App } from './components/App';
import { ServerProvider } from './components/ServerContext';
import * as modalsSlice from './modals/modalsSlice';

View File

@@ -191,6 +191,7 @@ export default defineConfig(async ({ mode }) => {
environment: 'jsdom',
globals: true,
setupFiles: './src/setupTests.js',
testTimeout: 10000,
onConsoleLog(log: string, type: 'stdout' | 'stderr'): boolean | void {
// print only console.error
return type === 'stderr';

View File

@@ -97,11 +97,11 @@
"devDependencies": {
"@electron/notarize": "2.5.0",
"@electron/rebuild": "4.0.1",
"@playwright/test": "1.52.0",
"@playwright/test": "1.55.1",
"@types/copyfiles": "^2",
"@types/fs-extra": "^11",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
"cross-env": "^10.1.0",
"electron": "38.0.0",
"electron-builder": "24.13.3",
"typescript": "^5.9.2"

View File

@@ -42,7 +42,7 @@
"@actual-app/api": "workspace:^",
"@actual-app/crdt": "workspace:^",
"@actual-app/web": "workspace:^",
"@swc/core": "^1.11.24",
"@swc/core": "^1.13.5",
"@types/adm-zip": "^0.5.7",
"@types/better-sqlite3": "^7.6.13",
"@types/emscripten": "^1.40.1",
@@ -52,10 +52,10 @@
"assert": "^2.1.0",
"browserify-zlib": "^0.2.0",
"buffer": "^6.0.3",
"cross-env": "^7.0.3",
"cross-env": "^10.1.0",
"fake-indexeddb": "^3.1.8",
"fast-check": "3.23.2",
"i18next": "^25.2.1",
"i18next": "^25.5.3",
"jest-diff": "^29.7.0",
"jsverify": "^0.8.4",
"memfs": "3.6.0",
@@ -63,7 +63,7 @@
"npm-run-all": "^4.1.5",
"path-browserify": "^1.0.1",
"peggy": "3.0.2",
"rollup-plugin-visualizer": "^6.0.3",
"rollup-plugin-visualizer": "^6.0.4",
"stream-browserify": "^3.0.0",
"ts-node": "^10.9.2",
"typescript": "^5.9.2",

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [matt-fidd]
---
Bump non-react dependencies in desktop-client

652
yarn.lock

File diff suppressed because it is too large Load Diff