Tree nodes sometimes get combined by accident if they are too similar
- Dominant language
- TypeScript
- Stars
- 16
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Incorrect:
Correct:
Code when incorrect:
```typescript
function renderInteractiveFilterQuery(
query: Query,
index: number,
state: AppState
): HtmlNode {
const path: QueryPath[] = [];
const days = runQuery(query, state.journalEntries).length;
return div(
[],
[class_("filter-query")],
[
div([], [], [renderQueryBuilder(query, index, [])]),
div(
[],
[class_("filter-query-result")],
[
text("A total of "),
strong([], [], [text(days.toString())]),
text(" days"),
]
),
div([], [], [renderRemoveQueryButton(index, path)]),
]
);
}
```
Work-around by adding an `id`:
```typescript
function renderInteractiveFilterQuery(
query: Query,
index: number,
state: AppState
): HtmlNode {
const path: QueryPath[] = [];
const days = runQuery(query, state.journalEntries).length;
const id = `${pathToKey(index, path)}-interactive-filter`;
return div(
[],
[class_("filter-query"), attribute("id", id)],
[
div([], [], [renderQueryBuilder(query, index, [])]),
div(
[],
[class_("filter-query-result")],
[
text("A total of "),
strong([], [], [text(days.toString())]),
text(" days"),
]
),
div([], [], [renderRemoveQueryButton(index, path)]),
]
);
}
```
Most likely a problem in the patching logic. Weirdly, I was only able to reproduce this via Playwright, and not via a regular Chrome or Electron browser.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.