Features: - Spreadsheet-like table with cell navigation (arrow keys) - Formula bar for editing cell values - Click and drag cell selection with Shift+Arrow extend - Column resize by dragging header borders, double-click for best fit - Editable headers via double-click - Command palette (Cmd+P) with 12 commands - Copy/Cut/Paste with CSV, Markdown, and Jira formats - Insert rows/columns above/below/left/right - File drag-and-drop to open CSV files - Native Open/Save dialogs - Go backend for CSV parsing, formatting, and file I/O - Vanilla JS frontend, no frameworks Co-authored-by: Shelley <shelley@exe.dev>
35 lines
1.2 KiB
Go
35 lines
1.2 KiB
Go
package main
|
|
|
|
// Command represents a command that can be executed in the application.
|
|
type Command struct {
|
|
ID string `json:"ID"`
|
|
Name string `json:"Name"`
|
|
Shortcut string `json:"Shortcut"`
|
|
}
|
|
|
|
// CommandRegistry provides command metadata to the frontend.
|
|
type CommandRegistry struct{}
|
|
|
|
// NewCommandRegistry creates a new CommandRegistry.
|
|
func NewCommandRegistry() *CommandRegistry {
|
|
return &CommandRegistry{}
|
|
}
|
|
|
|
// GetCommands returns the list of all available commands.
|
|
func (c *CommandRegistry) GetCommands() []Command {
|
|
return []Command{
|
|
{ID: "copy", Name: "Copy", Shortcut: "Cmd+C"},
|
|
{ID: "cut", Name: "Cut", Shortcut: "Cmd+X"},
|
|
{ID: "copy-markdown", Name: "Copy as Markdown", Shortcut: ""},
|
|
{ID: "copy-jira", Name: "Copy as Jira", Shortcut: ""},
|
|
{ID: "paste", Name: "Paste", Shortcut: "Cmd+V"},
|
|
{ID: "resize-all", Name: "Resize All Columns", Shortcut: ""},
|
|
{ID: "open", Name: "Open File", Shortcut: "Cmd+O"},
|
|
{ID: "save", Name: "Save File", Shortcut: "Cmd+S"},
|
|
{ID: "open-up", Name: "Insert Row Above", Shortcut: ""},
|
|
{ID: "open-down", Name: "Insert Row Below", Shortcut: ""},
|
|
{ID: "open-left", Name: "Insert Column Left", Shortcut: ""},
|
|
{ID: "open-right", Name: "Insert Column Right", Shortcut: ""},
|
|
}
|
|
}
|