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
1 change: 1 addition & 0 deletions .github/workspace-dep-closures.json
Original file line number Diff line number Diff line change
Expand Up @@ -4877,6 +4877,7 @@
"crates/macro_env_var",
"crates/macro_event_broker",
"crates/macro_event_topics",
"crates/macro_queues",
"crates/macro_service_urls",
"crates/macro_sync_service_jwt",
"crates/macro_tower_layers",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion apps/web/scripts/agent-fold.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ beforeAll(async () => {
module_or_path: readFileSync(new URL('agent_fold_bg.wasm', path)),
});
Stream = wasm.FoldStream;
}, 300_000);
// CI compiles the release WASM from scratch on every run, which takes 3–6
// minutes depending on the runner.
}, 600_000);

it('decodes durable DTOs, reconciles overlap, and folds a batch like a stream', () => {
const session = '00000000-0000-0000-0000-00000000000a';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,71 @@ test('imports independent XLSX through the file picker and exports real formulas
});
});

test('imports a macro-enabled .xlsm without its macros and exports a macro-free .xlsx', async ({
page,
}) => {
const chooser = page.waitForEvent('filechooser');
await menu(page, 'Import and export', 'Import…');
await (await chooser).setFiles(
fileURLToPath(
new URL('../core/xlsx-fixtures/poi-simple-macro.xlsm', import.meta.url)
)
);
const dialog = page.getByRole('dialog', { name: 'Import Excel workbook' });
await expect(dialog).toBeVisible();
await expect(dialog).toContainText('VBA macros are not imported.');
await page.getByRole('radio', { name: /Replace workbook/ }).check();
await page.getByRole('button', { name: 'Import workbook' }).click();
await expect(page.getByRole('tab')).toHaveCount(3);
await expect(page.locator('[data-address="A1"]')).toHaveText(
'This is a macro workbook'
);

const downloaded = page.waitForEvent('download');
await menu(page, 'Import and export', 'Download as Excel (.xlsx)');
const download = await downloaded;
expect(download.suggestedFilename()).toBe('Spreadsheet fixture.xlsx');
const path = await download.path();
if (!path) throw new Error('The workbook download was not saved.');
const workbook = new ExcelJS.Workbook();
await workbook.xlsx.readFile(path);
expect(workbook.worksheets.map((sheet) => sheet.name)).toEqual([
'Sheet1',
'Sheet2',
'Sheet3',
]);
expect(workbook.getWorksheet('Sheet1')?.getCell('A1').value).toBe(
'This is a macro workbook'
);
const { unzipSync } = await import('fflate');
const { readFileSync } = await import('node:fs');
expect(
Object.keys(unzipSync(readFileSync(path))).filter((name) =>
/vba/i.test(name)
)
).toEqual([]);
});

test('explains that legacy .xls workbooks convert when uploaded', async ({
page,
}) => {
const chooser = page.waitForEvent('filechooser');
await menu(page, 'Import and export', 'Import…');
await (await chooser).setFiles({
name: 'budget.xls',
mimeType: 'application/vnd.ms-excel',
buffer: Buffer.from([0xd0, 0xcf, 0x11, 0xe0]),
});
await expect(
page.getByText(
'Legacy .xls workbooks are converted when uploaded. Upload the file, then choose Edit in Macro.'
)
).toBeVisible();
await expect(
page.getByRole('dialog', { name: 'Import Excel workbook' })
).toHaveCount(0);
});

test('undo restores the original workbook after replacing it with an Excel import', async ({
page,
}) => {
Expand Down
7 changes: 4 additions & 3 deletions apps/web/src/features/block-spreadsheet/core/csv-file.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { csvImportEdits } from './sheet-operations';
import { decodeCsv, isUploadedWorkbook } from './uploaded-workbook';

describe('uploaded Excel/CSV detection', () => {
it.each(['xlsx', 'XLSX', 'csv', 'CSV'])('recognizes %s', (type) =>
expect(isUploadedWorkbook(type)).toBe(true)
it.each(['xlsx', 'XLSX', 'xlsm', 'XLSM', 'csv', 'CSV'])(
'recognizes %s',
(type) => expect(isUploadedWorkbook(type)).toBe(true)
);
it.each(['xls', 'xlsm', 'pdf', 'spreadsheet', '', null, undefined])(
it.each(['xls', 'xltm', 'pdf', 'spreadsheet', '', null, undefined])(
'rejects %s',
(type) => expect(isUploadedWorkbook(type)).toBe(false)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import type { WorkbookFileData } from './workbook-file-types';

export function isUploadedWorkbook(fileType: string | null | undefined) {
return /^(xlsx|csv)$/i.test(fileType ?? '');
return /^(xlsx|xlsm|csv)$/i.test(fileType ?? '');
}

/** CSV carries values, not executable formulas or cell types. Keep identifiers
Expand Down
Loading
Loading