Release RuneStone 0.1.3 and expand plugin plans
This commit is contained in:
@@ -74,10 +74,7 @@ async function quickOpen(name) {
|
||||
await page.keyboard.press("Control+p");
|
||||
await page.getByRole("textbox", { name: "Find a file" }).fill(name);
|
||||
await page.getByRole("dialog").getByRole("button").filter({ hasText: name }).first().click();
|
||||
if (await page.getByRole("button", { name: "Switch to IDE layout (Ctrl E)", exact: true }).count()) {
|
||||
await page.getByRole("button", { name: "Switch to IDE layout (Ctrl E)", exact: true }).click();
|
||||
}
|
||||
await page.locator(".monaco-editor textarea").waitFor();
|
||||
await page.locator('.live-writer .cm-content').waitFor();
|
||||
}
|
||||
|
||||
const source = '# Navigation\n\nBefore.\n\n| Name | Value | Formula |\n| --- | --- | --- |\n| Alpha | 12 | =B2*2 |\n| Beta | | tail |\n| Two<br>lines | short | end |\n\nAfter.\n';
|
||||
@@ -129,7 +126,6 @@ try {
|
||||
window.__TEST__.emit('workspace-event', { root: window.__TEST__.root, kind: 'create', paths: ['navigation.md'] });
|
||||
}, source);
|
||||
await quickOpen('navigation.md');
|
||||
await page.getByRole('button', { name: 'Switch to writing layout (Ctrl E)', exact: true }).click();
|
||||
await table.waitFor();
|
||||
|
||||
// Reproduce the reported right-arrow escape, including formula destinations.
|
||||
@@ -290,6 +286,36 @@ try {
|
||||
assert.equal(await edit.count(), 0);
|
||||
assert.equal(await page.locator('.live-writer .cm-content').evaluate(el => el === document.activeElement), true);
|
||||
|
||||
// A line break in a tall table keeps the caret and viewport in the active cell.
|
||||
const tallSource = '# Tall table\n\nBefore.\n\n| Name | Value |\n| --- | --- |\n' +
|
||||
Array.from({ length: 45 }, (_, i) => `| Row ${i + 1} | |`).join('\n') + '\n\nAfter.\n';
|
||||
await page.evaluate(text => {
|
||||
window.__TEST__.files.set('line-breaks.md', text);
|
||||
window.__TEST__.emit('workspace-event', { root: window.__TEST__.root, kind: 'create', paths: ['line-breaks.md'] });
|
||||
}, tallSource);
|
||||
await quickOpen('line-breaks.md');
|
||||
await table.waitFor();
|
||||
for (const [r, c, key] of [[1, 0, 'Shift+Enter'], [20, 0, 'Shift+Enter'], [21, 0, 'Enter'], [20, 0, 'Shift+Enter'], [20, 1, 'Shift+Enter'], [0, 0, 'Shift+Enter']]) {
|
||||
await at(r, c);
|
||||
const before = await page.locator('.live-writer .cm-scroller').evaluate(el => el.scrollTop);
|
||||
await page.keyboard.press(key);
|
||||
await expectCell(r, c);
|
||||
const after = await page.locator('.live-writer .cm-scroller').evaluate(el => el.scrollTop);
|
||||
assert.ok(Math.abs(after - before) < 50, `${key} in row ${r}: scroll moved from ${before} to ${after}`);
|
||||
await page.keyboard.type('Next line');
|
||||
await expectCell(r, c);
|
||||
assert.match(await edit.innerHTML(), /<br>Next line/);
|
||||
}
|
||||
await page.keyboard.press('Escape');
|
||||
await page.keyboard.press('Control+s');
|
||||
await page.waitForFunction(() => {
|
||||
const source = window.__TEST__.files.get('line-breaks.md');
|
||||
return source.includes('| Name<br>Next line | Value |') &&
|
||||
source.includes('| Row 1<br>Next line | |') &&
|
||||
source.includes('| Row 21<br>Next line | |') &&
|
||||
/\| Row 20<br>Next line<br>Next line \| <br>Next line\s*\|/.test(source);
|
||||
});
|
||||
|
||||
// A table at the document boundary still offers somewhere to type outside it.
|
||||
const loneTable = '| Name |\n| --- |\n| Value |';
|
||||
for (const [key, after] of [['ArrowLeft', false], ['ArrowUp', false], ['ArrowRight', true], ['ArrowDown', true]]) {
|
||||
@@ -299,7 +325,6 @@ try {
|
||||
window.__TEST__.emit('workspace-event', { root: window.__TEST__.root, kind: 'create', paths: [name] });
|
||||
}, { name, text: loneTable });
|
||||
await quickOpen(name);
|
||||
await page.getByRole('button', { name: 'Switch to writing layout (Ctrl E)', exact: true }).click();
|
||||
await table.waitFor();
|
||||
await at(after ? 1 : 0, 0, after ? 'End' : 'Home');
|
||||
await page.keyboard.press(key);
|
||||
@@ -317,7 +342,7 @@ try {
|
||||
await page.waitForFunction(({ name, expected }) => window.__TEST__.files.get(name) === expected, { name, expected });
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
console.log('PASS: arrows, caret positions, row wrapping, empty/formula/header cells, entry/exit in all directions, goal columns, document boundaries, text selection, word movement, multiline/wrapped text, save, undo/redo, Tab and Escape');
|
||||
console.log('PASS: arrows, caret positions, row wrapping, empty/formula/header cells, entry/exit in all directions, goal columns, document boundaries, text selection, word movement, multiline/wrapped text, line breaks and scrolling in tall tables, save, undo/redo, Tab and Escape');
|
||||
} catch (error) {
|
||||
await page.screenshot({ path: '.audit/table-navigation-failure.png' });
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user