Skip to content

Add session permanent delete and click-drag multi-select#887

Open
Rhoahndur wants to merge 1 commit intohumanlayer:mainfrom
Rhoahndur:feature/session-delete-and-multiselect
Open

Add session permanent delete and click-drag multi-select#887
Rhoahndur wants to merge 1 commit intohumanlayer:mainfrom
Rhoahndur:feature/session-delete-and-multiselect

Conversation

@Rhoahndur
Copy link
Copy Markdown

@Rhoahndur Rhoahndur commented Dec 4, 2025

What problem(s) was I solving?

  1. Users couldn't permanently delete sessions - only archive them
  2. No mouse-based multi-select for sessions (only keyboard shortcuts)

What user-facing changes did I ship?

  • Action menu (three dots) on session row hover with Archive and Delete options
  • Delete confirmation dialog with session count
  • Backspace hotkey to delete focused/selected sessions
  • Click-drag to select multiple contiguous sessions

How I implemented it

Backend:

  • Added DELETE /sessions/{id}/hard-delete endpoint for single session
  • Added POST /sessions/hard-delete/bulk endpoint for batch delete

Frontend:

  • DeleteSessionDialog component with keyboard shortcuts (Cmd+Enter to confirm, Esc to cancel)
  • Dropdown action menu on each session row
  • Drag selection state tracking with mousedown/mousemove/mouseup handlers - this may need further adjustments I like the behavior but definitely open and interested in feedback on the dynamic
  • HTTP client methods for delete operations

How to verify it

  • I have ensured make check test passes
  1. Hover over a session row - verify three-dot menu appears
  2. Click Delete - verify confirmation dialog shows
  3. Confirm delete - verify session is removed
  4. Select multiple sessions with keyboard (x key) then press Backspace
  5. Click and drag across multiple rows - verify they get selected

Description for the changelog

Added permanent session deletion with confirmation dialog, action menu on rows, and click-drag multi-select for sessions.


Important

This PR adds permanent session deletion and click-drag multi-select functionality, with new backend endpoints and frontend updates including a confirmation dialog and hotkeys.

  • Backend:
    • Added DELETE /sessions/{id}/hard-delete and POST /sessions/hard-delete/bulk endpoints in sessions.go for permanent session deletion.
    • Updated openapi.yaml to include new endpoints and request/response schemas.
  • Frontend:
    • Added DeleteSessionDialog component in DeleteSessionDialog.tsx for delete confirmation with hotkeys (Cmd+Enter to confirm, Esc to cancel).
    • Updated SessionTable.tsx to include a dropdown menu with Archive and Delete options, and implemented click-drag multi-select functionality.
    • Added hotkey support for session deletion (Backspace) and multi-select in SessionTable.tsx.
  • Misc:
    • Updated http-client.ts with methods hardDeleteSession and bulkHardDeleteSessions for API calls.
    • Added DELETE_SESSION_DIALOG to HOTKEY_SCOPES in scopes.ts.

This description was created by Ellipsis for e6b08ea. You can customize this summary. It will automatically update as commits are pushed.

- Add hard delete endpoint for sessions (any status)
- Add bulk hard delete endpoint
- Add delete confirmation dialog with keyboard shortcuts
- Add action menu on session rows (archive/delete)
- Add Backspace hotkey to delete focused/selected sessions
- Add click-drag to select multiple sessions
- Frontend http-client methods for delete operations
Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to e6b08ea in 2 minutes and 50 seconds. Click for details.
  • Reviewed 1601 lines of code in 9 files
  • Skipped 0 files when reviewing.
  • Skipped posting 8 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. hld/session/manager.go:1496
  • Draft comment:
    In the ContinueSession function the session config now uses req.GetQueryFromContentBlocks() instead of a raw query string. This is a good design for supporting mixed content; however, consider logging a warning if no text is found in the content blocks and the fallback query (c.Query) is used, so that edge cases (e.g. when only image blocks are provided) are tracked.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% The comment assumes there's a fallback to c.Query when no text is found in content blocks, but I don't see this fallback in the visible code. The method GetQueryFromContentBlocks() is called directly without any conditional logic checking if it returns empty. The comment also mentions tracking edge cases "when only image blocks are provided", but there's already a warning for image content at lines 1510-1514. Without seeing the implementation of GetQueryFromContentBlocks(), I can't confirm if it has internal fallback logic to c.Query. The comment seems speculative about behavior that may not exist, or at least isn't visible in the changes. I might be missing the implementation details of GetQueryFromContentBlocks() which could contain the fallback logic the comment refers to. The comment could be based on knowledge of that method's implementation that I don't have access to in this context. Even if GetQueryFromContentBlocks() has internal fallback logic, the comment is speculative ("Consider logging...") rather than pointing to a definite issue. The code already has image content warnings. Without seeing clear evidence that this is a problem or that the fallback exists and needs tracking, this is more of a "nice to have" suggestion rather than an actionable code issue. The rules state not to make speculative comments. This comment is speculative and suggests a "nice to have" logging enhancement rather than identifying a clear code issue. There's already logging for image content, and the suggested fallback behavior isn't visible in the diff. This violates the rule against speculative comments.
2. hld/session/types.go:127
  • Draft comment:
    The GetQueryFromContentBlocks helper correctly concatenates text from all content blocks. It might be useful to add documentation (or tests) to clarify what happens when there are content blocks present but none with the type 'text' – i.e. ensuring the fallback to c.Query. This will make behavior explicit.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
3. humanlayer-wui/src/components/internal/SessionDetail/components/DeleteSessionDialog.tsx:21
  • Draft comment:
    The DeleteSessionDialog component cleanly implements the confirmation dialog with hotkeys. For improved accessibility, verify that underlying Dialog components set appropriate ARIA roles and labels (or add them explicitly) to assist screen readers.
  • Reason this comment was not posted:
    Comment was on unchanged code.
4. humanlayer-wui/src/components/internal/SessionTable.tsx:312
  • Draft comment:
    The drag selection logic (using handleRowMouseDown and handleTableMouseMove) is implemented in a clear way by storing a potential drag start and then selecting a range. It would be good to ensure thorough testing of rapid mouse movements and to verify that all ref values (like isPotentialDragRef) are properly reset in every edge case.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to ensure thorough testing and verify certain behaviors, which violates the rule against asking for confirmation or ensuring testing. It doesn't provide a specific suggestion or point out a specific issue.
5. humanlayer-wui/src/components/internal/SessionTable.tsx:800
  • Draft comment:
    The useHotkeys handler for the 'backspace' key to delete sessions is an intuitive approach. Consider adding further checks (for example, ensuring the event isn’t coming from within an input or editable element) to mitigate the risk of accidental deletions when the user might be editing text.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 25% vs. threshold = 50% The comment raises a valid concern about accidental deletions. However, looking at the implementation, there are already several protections in place: 1) The hotkey is disabled when isInlineRenameOpen is true (line 822), 2) The hotkey is scoped to the table scope which may not be active when editing, 3) The library react-hotkeys-hook may have built-in protections. The comment suggests adding enableOnFormTags: false which I see used in other hotkey handlers in this file (lines 723, 749, 766). This is actually a good suggestion - the backspace hotkey handler is missing this option that other handlers have. However, I need to consider if this is truly necessary given the existing isInlineRenameOpen check. The enableOnFormTags: false would provide defense-in-depth protection. The existing isInlineRenameOpen check may already be sufficient since it explicitly checks if editing is happening. The comment is somewhat speculative ("to mitigate the risk") rather than pointing to a concrete bug. Also, I don't have full context on how the hotkey scoping system works - it's possible the scope-based protection is already sufficient. The comment doesn't provide evidence that there's an actual problem. While the existing checks may be sufficient, the comment does point out an inconsistency - other hotkey handlers in this file use enableOnFormTags: false (lines 723, 749, 766) but this new backspace handler doesn't. This suggests it might be a best practice that was overlooked. However, this is more of a "nice to have" defensive programming suggestion rather than a critical bug fix. The comment is also somewhat vague ("further checks") and doesn't specify exactly what should be added. The comment identifies a potential inconsistency (missing enableOnFormTags: false) but the existing isInlineRenameOpen check likely provides adequate protection. The comment is speculative and doesn't demonstrate an actual bug. Given the rule to only keep comments with STRONG EVIDENCE of correctness, and that this is more of a defensive programming suggestion than a clear issue, I should delete this comment.
6. humanlayer-wui/src/components/internal/SessionTable.tsx:519
  • Draft comment:
    The mechanism capturing the 'g>e' hotkey to block the archive action triggered by a later 'e' press is clever. However, the 50ms threshold may be fragile across different devices or browsers. Consider testing on various platforms or making the threshold configurable.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. humanlayer-wui/src/lib/daemon/http-client.ts:448
  • Draft comment:
    In hardDeleteSession, the fetch call correctly checks the response status. To improve error diagnostics, consider parsing and logging the response body (if available) when response.ok is false, as this might provide more insight into why the deletion failed.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 30% vs. threshold = 50% This comment is suggesting a code quality improvement - better error diagnostics by parsing the response body. It's not pointing out a bug or something that will break. The comment uses "consider", which indicates it's a suggestion rather than identifying a required fix. According to the rules, comments should only be kept if there is "clearly a code change required" and should be "actionable and clear". While this is actionable and clear, it's not a required change - the code will work fine as-is. This falls into the category of a code quality refactor suggestion, which the rules say are "good! But only if they are actionable and clear." This one is actionable and clear, so it might be worth keeping. The comment is a reasonable suggestion for improving error diagnostics, and there is precedent in the codebase for this pattern (see launchDraftSession). This could genuinely help with debugging. The suggestion is actionable and specific. However, the word "consider" makes it sound optional rather than required, which might violate the spirit of "clearly a code change required." While the suggestion is reasonable and actionable, it's framed as optional ("consider") and is about improving diagnostics rather than fixing a bug or preventing an issue. The current implementation is functional and follows a common pattern. Without strong evidence that this specific endpoint returns useful error bodies that need to be logged, this is more of a "nice to have" than a required change. This comment should be deleted. While it's a reasonable code quality suggestion, it's framed as optional ("consider") and doesn't identify a required change. The current error handling is functional, and without evidence that this specific endpoint needs enhanced error parsing, this falls into the category of speculative improvements rather than clearly required changes.
8. humanlayer-wui/src/lib/daemon/http-client.ts:461
  • Draft comment:
    Similarly, in bulkHardDeleteSessions, if the fetch response is not OK, the error thrown only includes the status text. Enhancing the error message by including parsed details from the response body would aid debugging.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 30% vs. threshold = 50% This comment is about a newly added method in the diff, so it IS about changes. It's suggesting a code quality improvement - making error messages more informative by including response body details. This is actionable and clear. However, I need to check if this violates any rules. The rules say "Comments that suggest code quality refactors are good! But only if they are actionable and clear." This seems to fit that criteria. It's not speculative, not about styling, not asking for confirmation, and it's a concrete suggestion. Looking at other methods in the file like hardDeleteSession (line 456), it has the same pattern of only including statusText. So this is a consistent pattern in the codebase, which might suggest the comment is nitpicky. But the comment is specifically about the NEW code being added, not existing code. The comment might be considered too minor or nitpicky since the existing codebase already has this same pattern (e.g., hardDeleteSession at line 456 also only includes statusText). If this pattern is acceptable elsewhere in the file, why should this new method be different? Also, the comment uses "would aid debugging" which is somewhat speculative about the value. While the pattern exists elsewhere, the comment is still about new code being added in this PR. The suggestion is actionable and clear - parse the response body and include it in the error. This is a legitimate code quality improvement. However, given that the same pattern exists in hardDeleteSession (also added in this diff at line 456), and the comment only targets one of the two methods, it seems inconsistent and potentially not important enough to warrant a comment. The comment is about new code and suggests an actionable improvement. However, it's inconsistent because the same issue exists in hardDeleteSession (line 456) which was also added in this diff, but wasn't commented on. This suggests the issue is either not important enough to warrant a comment, or the automated tool was inconsistent. Given the rule to only keep comments with STRONG EVIDENCE they are correct and important, and the inconsistency here, I should delete this comment.

Workflow ID: wflow_sNTw7wUgnbDMUx9L

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

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