Skip to content

Comments

feature: collapsable tx in web#16

Merged
mickamy merged 6 commits intomainfrom
feature/collapsable-tx-in-web
Feb 21, 2026
Merged

feature: collapsable tx in web#16
mickamy merged 6 commits intomainfrom
feature/collapsable-tx-in-web

Conversation

@mickamy
Copy link
Owner

@mickamy mickamy commented Feb 21, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 21, 2026 07:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds transaction grouping to the web events table, with collapsible transaction summary rows and per-transaction color cues to make related queries easier to scan.

Changes:

  • Widen the filter input to accommodate longer expressions.
  • Render a transaction “summary” row (expand/collapse) when no filter is active, and indent child events.
  • Apply a 6-color palette per transaction (summary row uses the color across all cells; child rows color the op column).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
web/static/style.css Adds styling for transaction summary/child rows and tx color palette; widens filter input.
web/static/app.js Implements tx grouping/collapsing logic, tx summary rendering, and tx color assignment/reset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 21, 2026 07:04
mickamy and others added 2 commits February 21, 2026 16:05
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 291 to 299
}
}
} else if (txId && seenTx.has(txId)) {
// Already handled by summary — skip
} else {
rows.push({kind: 'event', eventIdx: i});
}
}
return rows;
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The txSummaryInfo function doesn't handle empty indices array. If row.eventIndices is empty, accessing indices[0] and indices[indices.length - 1] will return undefined, causing subsequent operations to fail. While this might not occur in normal operation, defensive programming suggests adding a guard check at the start of the function.

Copilot uses AI. Check for mistakes.
Comment on lines +284 to +286
seenTx.add(txId);
const entry = txIndex.get(txId);
const indices = entry ? entry.indices : [i];
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Events with a tx_id but without a corresponding Begin event in the array will be displayed as individual rows (line 285). However, if these events are part of a transaction that was started before monitoring began, they might appear out of context. Consider adding visual indication or handling for orphaned transaction events to make this behavior clearer to users.

Copilot uses AI. Check for mistakes.
Comment on lines +333 to +337
for (const row of displayRows) {
if (row.kind === 'tx') {
const info = txSummaryInfo(row.eventIndices);
const collapsed = collapsedTx.has(row.txId);
const chevron = collapsed ? '\u25b8' : '\u25be';
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chevron is purely visual without semantic meaning for screen readers. Consider adding an aria-label to the tx-summary row or wrapping the chevron in a button element with proper ARIA attributes to indicate its expandable/collapsible state for accessibility.

Copilot uses AI. Check for mistakes.
Comment on lines +269 to +276
const txId = ev.tx_id;
if (!txId) continue;
let entry = txIndex.get(txId);
if (!entry) {
entry = { indices: [] };
txIndex.set(txId, entry);
}
entry.indices.push(i);
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic assumes that transactions will always have a Begin event with op === 'Begin', and groups events starting from that Begin. However, if events are received out of order (e.g., Begin arrives after some other transaction events), or if Begin was missed, the transaction events might not be properly grouped. Consider whether this is the intended behavior or if there should be handling for out-of-order events.

Copilot uses AI. Check for mistakes.
.sql-num { color: #b5cea8; }
.sql-param { color: #9cdcfe; }

/* Transaction grouping */
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 198 sets a default color for all tx-summary cells, but lines 211-216 override this with specific colors per data-tx-color attribute. The default color on line 198 will only apply when data-tx-color is not set (which should not happen based on the JS code). Consider removing the redundant color property from line 198 or clarifying its purpose with a comment if it's intentional as a fallback.

Suggested change
/* Transaction grouping */
/* Transaction grouping */
/* Default/fallback color for tx-summary rows when data-tx-color is not set */

Copilot uses AI. Check for mistakes.
@mickamy mickamy merged commit 49720c6 into main Feb 21, 2026
7 checks passed
@mickamy mickamy deleted the feature/collapsable-tx-in-web branch February 21, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant