Match Row: selects all rows where the cell in the current column equals the current cell's value. Selection spans first-to-last matching row across all columns. Delete Row (Cmd+Backspace): deletes every row in the current selection, or the single current row if nothing is selected. Ensures at least one empty row always remains. Co-authored-by: Shelley <shelley@exe.dev>
40 lines
1.5 KiB
Go
40 lines
1.5 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: ""},
|
|
{ID: "sort-asc", Name: "Sort A-Z", Shortcut: ""},
|
|
{ID: "sort-desc", Name: "Sort Z-A", Shortcut: ""},
|
|
{ID: "sort-advanced", Name: "Sort Advanced", Shortcut: ""},
|
|
{ID: "match-row", Name: "Match Row", Shortcut: ""},
|
|
{ID: "delete-row", Name: "Delete Row", Shortcut: "Cmd+Backspace"},
|
|
}
|
|
}
|