Skip to content

feat: add activate event to GridView on Enter key press#511

Merged
willeastcott merged 2 commits into
mainfrom
feat/gridview-activate-event
Feb 27, 2026
Merged

feat: add activate event to GridView on Enter key press#511
willeastcott merged 2 commits into
mainfrom
feat/gridview-activate-event

Conversation

@willeastcott

@willeastcott willeastcott commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds an activate event to GridView that fires when the user presses Enter on a focused GridViewItem or double-clicks one
  • Follows the same EVENT_* constant and @event JSDoc pattern used by TreeView
  • Abstracts activation as an intent-level event, consistent with how mature UI toolkits (GTK, Qt, WPF) handle item activation

Test plan

  • Create a GridView with items and listen for the activate event
  • Focus an item with arrow keys, press Enter -- verify the event fires with the correct GridViewItem
  • Double-click an item -- verify the same activate event fires
  • Verify arrow key navigation still works as before
  • Verify Enter does nothing when focus is on an <input> element inside a grid item
  • Verify EVENT_ACTIVATE constant appears in TypeDoc output

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an activate event to the GridView component that triggers when users press Enter on a focused GridViewItem or double-click on one. This follows established UI toolkit patterns (GTK, Qt, WPF) where activation is a distinct intent-level event separate from selection. The implementation mirrors the event constant and documentation patterns used by TreeView in this codebase.

Changes:

  • Added EVENT_ACTIVATE constant with JSDoc documentation following codebase conventions
  • Extended keydown handler to recognize Enter key and emit the activate event
  • Added double-click handler to emit the same activate event
  • Updated destroy method to properly clean up the new double-click event listener

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

@willeastcott willeastcott merged commit c2f541e into main Feb 27, 2026
9 checks passed
@willeastcott willeastcott deleted the feat/gridview-activate-event branch February 27, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants