cli/pkg/display/FEATURES.md

9.4 KiB

Display Server Features for Claude Code Integration

This document tracks the implementation of display server features that enable AI-assisted development workflows.

Status Legend

  • Not started
  • Complete
  • [~] In progress

Window Management

Core Window Operations

  • window_list - List all windows with positions/sizes
  • window_get - Get specific window info
  • window_position - Move window to coordinates
  • window_size - Resize window
  • window_bounds - Set position + size in one call
  • window_maximize - Maximize window
  • window_minimize - Minimize window
  • window_restore - Restore from maximized/minimized
  • window_focus - Bring window to front
  • Window state persistence (remembers position across restarts)

Extended Window Operations

  • window_create - Create new window at specific position with URL
  • window_close - Close a window by name
  • window_visibility - Show/hide window without closing
  • window_title_set - Change window title dynamically
  • window_title_get - Get current window title (returns window name)
  • window_always_on_top - Pin window above others
  • window_background_colour - Set window background color with alpha (transparency)
  • window_fullscreen - Enter/exit fullscreen mode

Screen/Monitor Management

Screen Information

  • screen_list - List all screens/monitors
  • screen_get - Get specific screen by ID
  • screen_primary - Get primary screen info
  • screen_work_area - Get usable area (excluding dock/menubar)
  • screen_at_point - Get screen containing a point
  • screen_for_window - Get screen a window is on

Layout Management

Layout Operations

  • layout_save - Save current window arrangement with a name
  • layout_restore - Restore a saved layout by name
  • layout_list - List saved layouts
  • layout_delete - Delete a saved layout
  • layout_get - Get details of a specific layout

Smart Layout

  • layout_tile - Auto-tile windows (left/right/top/bottom/quadrants/grid)
  • layout_stack - Stack windows in cascade pattern
  • layout_beside_editor - Position window beside detected IDE window
  • layout_suggest - Given screen dimensions, suggest optimal arrangement
  • layout_snap - Snap window to screen edge/corner/center

AI-Optimized Layout

  • screen_find_space - Find empty screen space for new window
  • window_arrange_pair - Put two windows side-by-side optimally
  • layout_workflow - Preset layouts: "coding", "debugging", "presenting", "side-by-side"

WebView/Browser Features

JavaScript Execution

  • webview_eval - Execute JavaScript and return result
  • webview_list - List all webview windows

Console & Errors

  • webview_console - Get console messages (log, warn, error, info)
  • webview_errors - Get structured JS errors with stack traces
  • webview_clear_console - Clear console buffer

DOM Inspection

  • webview_query - Query elements by CSS selector
  • webview_dom_tree - Get full DOM tree structure
  • webview_element_info - Get detailed info about an element
  • webview_highlight - Visually highlight an element (debugging)
  • webview_computed_style - Get computed styles for element

Interaction

  • webview_click - Click element by selector
  • webview_type - Type into element
  • webview_navigate - Navigate to URL/route
  • webview_scroll - Scroll to element or position
  • webview_hover - Hover over element
  • webview_select - Select option in dropdown
  • webview_check - Check/uncheck checkbox

Page Information

  • webview_source - Get page HTML source
  • webview_url - Get current URL
  • webview_title - Get page title
  • webview_screenshot - Capture rendered page as image
  • webview_screenshot_element - Capture specific element as image
  • webview_pdf - Export page as PDF (using html2pdf.js)
  • webview_print - Open native print dialog

Network & Performance

  • webview_network - Get network requests log (via Performance API)
  • webview_network_clear - Clear network log
  • webview_network_inject - Inject fetch/XHR interceptor for detailed logging
  • webview_performance - Get performance metrics (load time, memory)
  • webview_resources - List loaded resources (scripts, styles, images)

DevTools

  • webview_devtools_open - Open DevTools for window
  • webview_devtools_close - Close DevTools

System Integration

Clipboard

  • clipboard_read - Read clipboard text content
  • clipboard_write - Write text to clipboard
  • clipboard_read_image - Read image from clipboard
  • clipboard_write_image - Write image to clipboard
  • clipboard_has - Check clipboard content type
  • clipboard_clear - Clear clipboard contents

Notifications

  • notification_show - Show native system notification (macOS/Windows/Linux)
  • notification_permission_request - Request notification permission
  • notification_permission_check - Check notification authorization status
  • notification_clear - Clear notifications
  • notification_with_actions - Interactive notifications with buttons

Dialogs

  • dialog_open_file - Show file open dialog
  • dialog_save_file - Show file save dialog
  • dialog_open_directory - Show directory picker
  • dialog_message - Show message dialog (info/warning/error) (via notification_show)
  • dialog_confirm - Show confirmation dialog
  • [~] dialog_prompt - Show input prompt dialog (not supported natively in Wails v3)

Theme & Appearance

  • theme_get - Get current theme (dark/light)
  • theme_set - Set application theme
  • theme_system - Get system theme preference
  • theme_on_change - Subscribe to theme changes (via WebSocket events)

Focus & Events

Focus Management

  • window_focused - Get currently focused window
  • focus_set - Set focus to specific window (alias for window_focus)

Event Subscriptions (WebSocket)

  • event_subscribe - Subscribe to events (via WebSocket /events endpoint)
  • event_unsubscribe - Unsubscribe from events
  • event_info - Get WebSocket event server info
  • Events: window.focus, window.blur, window.move, window.resize, window.close, window.create, theme.change

System Tray

  • tray_set_icon - Set tray icon (base64 PNG)
  • tray_set_tooltip - Set tray tooltip
  • tray_set_label - Set tray label text
  • tray_set_menu - Set tray menu items (with nested submenus)
  • tray_info - Get tray status info
  • tray_show_message - Show tray balloon notification

Implementation Priority

Phase 1 - Core Display Server (DONE)

  • Window list/get/position/size/bounds
  • Window maximize/minimize/restore/focus
  • Window state persistence
  • HTTP REST bridge for tools

Phase 2 - Enhanced Windows (DONE)

  • window_create, window_close
  • window_visibility, window_always_on_top
  • screen_work_area, window_fullscreen, window_title

Phase 3 - Layouts (DONE)

  • layout_save, layout_restore, layout_list
  • layout_delete, layout_get
  • layout_tile, layout_beside_editor (future)

Phase 4 - WebView Debug (DONE)

  • webview_screenshot, webview_screenshot_element
  • webview_url, webview_source, webview_title
  • webview_dom_tree, webview_element_info, webview_computed_style
  • webview_scroll, webview_hover, webview_select, webview_check
  • webview_highlight, webview_errors
  • webview_performance, webview_resources
  • webview_network, webview_devtools (future)

Phase 5 - System Integration (DONE)

  • clipboard_read, clipboard_write, clipboard_has, clipboard_clear
  • notification_show (native + dialog fallback)
  • notification_permission_request, notification_permission_check
  • dialog_open_file, dialog_save_file, dialog_open_directory, dialog_confirm
  • theme_get, theme_system

Phase 6 - Events & Real-time (DONE)

  • WebSocket event subscriptions (/events endpoint)
  • Real-time window tracking (focus, blur, move, resize, close, create)
  • Theme change events
  • focus_set, screen_get, screen_primary, screen_at_point, screen_for_window

Phase 7 - Advanced Features (DONE)

  • window_background_colour - Window transparency via RGBA alpha
  • layout_tile - Auto-tile windows in grid/halves/quadrants
  • layout_snap - Snap windows to edges/corners/center
  • layout_stack - Cascade windows in stacked pattern
  • layout_workflow - Preset layouts (coding/debugging/presenting)
  • webview_network - Network request logging
  • webview_network_clear - Clear network log
  • webview_network_inject - Detailed fetch/XHR interceptor
  • webview_pdf - Export page as PDF
  • webview_print - Native print dialog
  • tray_set_icon - Set tray icon dynamically
  • tray_set_tooltip - Set tray tooltip
  • tray_set_label - Set tray label
  • tray_set_menu - Set tray menu items
  • tray_info - Get tray status

Phase 8 - Remaining Features (Future)

  • window_opacity (true opacity if Wails adds support)
  • layout_beside_editor, layout_suggest
  • webview_devtools_open, webview_devtools_close
  • clipboard_read_image, clipboard_write_image
  • notification_with_actions, notification_clear
  • tray_show_message - Balloon notifications