Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Keep mixed-list bullet markers visible (PRD-8959) (#7439)

Andrew Mikofalvy9176921f5a3d
diff --git a/.changeset/mixed-list-markers.md b/.changeset/mixed-list-markers.md
new file mode 100644
index 000000000..7c9dac79f
--- /dev/null
+++ b/.changeset/mixed-list-markers.md
@@ -0,0 +1,5 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+Keep bullet markers visible when normal and checkbox items share a list.
diff --git a/packages/app/src/globals.css b/packages/app/src/globals.css
index 4bfa52f8c..6df9d4a27 100644
--- a/packages/app/src/globals.css
+++ b/packages/app/src/globals.css
@@ -1747,12 +1747,13 @@ section[data-editor-pane-id] {
}
/* Task lists — unified List extension emits <li data-type="taskItem"> */
-.ProseMirror ul:has(> li[data-type="taskItem"]) {
+.ProseMirror ul:has(> li[data-type="taskItem"]):not(:has(> li:not([data-type="taskItem"]))) {
list-style: none;
padding-left: 0;
}
.ProseMirror li[data-type="taskItem"] {
+ list-style-type: none;
display: flex;
align-items: flex-start;
gap: 0.5em;
diff --git a/packages/app/tests/foundation/babel-output-cache.node.test.ts b/packages/app/tests/foundation/babel-output-cache.node.test.ts
index 806bcb867..0f516a91e 100644
--- a/packages/app/tests/foundation/babel-output-cache.node.test.ts
+++ b/packages/app/tests/foundation/babel-output-cache.node.test.ts
@@ -306,6 +306,7 @@ const note = (name) => {
process.env = new Proxy(process.env, {
get(target, name) { note(name); return Reflect.get(target, name); },
has(target, name) { note(name); return Reflect.has(target, name); },
+ set(target, name, value) { return Reflect.set(target, name, value); },
});
const { createServer, loadConfigFromFile } = await import('vite');
const root = process.cwd();
@@ -328,7 +329,7 @@ process.stdout.write(JSON.stringify({ passes: plugins.length, configReads: [...c
process.exit(0);
`;
-function observeEnvReads(): Promise<{
+function observeEnvReads(debug: string | undefined): Promise<{
passes: number;
configReads: string[];
compileReads: string[];
@@ -339,7 +340,11 @@ function observeEnvReads(): Promise<{
execFile(
process.execPath,
['--input-type=module', '--eval', OBSERVE_ENV_READS, cacheDir, ...unseenIds()],
- { cwd: APP_ROOT, env: { ...process.env, TMPDIR: dir }, timeout: COMPILE_TIMEOUT_MS },
+ {
+ cwd: APP_ROOT,
+ env: { ...process.env, TMPDIR: dir, DEBUG: debug },
+ timeout: COMPILE_TIMEOUT_MS,
+ },
(error, stdout, stderr) => {
if (error) reject(new Error(`observing the compile failed: ${stderr || error.message}`));
else resolve(JSON.parse(stdout));
@@ -349,10 +354,10 @@ function observeEnvReads(): Promise<{
}
describe('the cache key covers every environment value the compile reads', () => {
- test(
- 'the config’s Babel option code and a cold compile of a product and a test module read only keyed environment values',
- async () => {
- const observed = await observeEnvReads();
+ test.each([undefined, 'vitest:browser:gc,pw:browser'])(
+ 'the config’s Babel option code and a cold compile of a product and a test module read only keyed environment values with DEBUG=%s',
+ async (debug) => {
+ const observed = await observeEnvReads(debug);
expect(observed.passes).toBe(appBrowserBabelPasses().length);
expect(observed.compileReads).toContain('NODE_ENV');
diff --git a/packages/app/tests/stress/mixed-list-markers.e2e.ts b/packages/app/tests/stress/mixed-list-markers.e2e.ts
new file mode 100644
index 000000000..3d780102f
--- /dev/null
+++ b/packages/app/tests/stress/mixed-list-markers.e2e.ts
@@ -0,0 +1,67 @@
+import { randomUUID } from 'node:crypto';
+import { expect, simulateCopyAndRead, test, waitForActiveProviderSynced } from './_helpers';
+
+test('mixed task lists keep ordinary bullet markers at every nesting level', async ({
+ page,
+ api,
+}) => {
+ const docName = `mixed-list-markers-${randomUUID()}`;
+ await api.seedDocs([
+ {
+ name: docName,
+ markdown: [
+ '# Mixed list markers',
+ '',
+ '- One',
+ '- [ ] Two',
+ '- Three',
+ ' - Nested one',
+ ' - [x] Nested two',
+ ' - Nested three',
+ ' - Deep one',
+ ' - [ ] Deep two',
+ ' - Deep three',
+ '',
+ '## Task-only list',
+ '',
+ '- [ ] Task only one',
+ '- [x] Task only two',
+ '',
+ ].join('\n'),
+ },
+ ]);
+ await page.goto(`/#/${docName}`);
+ await waitForActiveProviderSynced(page);
+ const editor = page.locator('.ProseMirror:not(.composer-prosemirror)');
+ await expect(editor).toBeVisible();
+
+ for (const [text, marker] of [
+ ['One', 'disc'],
+ ['Nested one', 'circle'],
+ ['Deep one', 'square'],
+ ] as const) {
+ const item = editor.locator('li').filter({ hasText: new RegExp(`^${text}$`) });
+ await expect(item).toHaveCSS('display', 'list-item');
+ await expect(item).toHaveCSS('list-style-type', marker);
+ }
+
+ const tasks = editor.locator('ul').filter({ hasText: 'Task only one' });
+ await expect(tasks).toHaveCSS('padding-left', '0px');
+ const checkbox = editor.getByRole('checkbox').first();
+ await checkbox.check();
+ await expect(checkbox).toBeChecked();
+ await expect(editor.locator('li').filter({ hasText: /^One$/ })).toHaveCSS(
+ 'list-style-type',
+ 'disc',
+ );
+
+ const copied = await simulateCopyAndRead(page);
+ const copiedTaskMarkers = await page.evaluate((html) => {
+ const document = new DOMParser().parseFromString(html, 'text/html');
+ return Array.from(
+ document.querySelectorAll<HTMLLIElement>('li[data-type="taskItem"]'),
+ (item) => item.style.listStyleType,
+ );
+ }, copied.html);
+ expect(copiedTaskMarkers).toEqual(Array(5).fill('none'));
+});