Documentation
¶
Index ¶
- Constants
- Variables
- func AdjustOrigin(v *gocui.View, originY *int)
- func Black(text string) string
- func Blink(text string) string
- func Blue(text string) string
- func Bold(text string) string
- func Colorize(text string, color Color) string
- func CopyToClipboard(text string) error
- func Cyan(text string) string
- func Dim(text string) string
- func Gray(text string) string
- func Green(text string) string
- func Italic(text string) string
- func Magenta(text string) string
- func Orange(text string) string
- func Red(text string) string
- func Reverse(text string) string
- func StrikeThru(text string) string
- func Stylize(text string, style Style) string
- func Underline(text string) string
- func White(text string) string
- func Yellow(text string) string
- type App
- func (a *App) CloseModal()
- func (a *App) CopyMigrationInfo()
- func (a *App) DeleteMigration()
- func (a *App) FocusNext()
- func (a *App) FocusPrevious()
- func (a *App) Generate()
- func (a *App) GetCurrentPanel() Panel
- func (a *App) GetGui() *gocui.Gui
- func (a *App) HasActiveModal() bool
- func (a *App) MigrateDeploy()
- func (a *App) MigrateDev()
- func (a *App) MigrateResolve()
- func (a *App) OpenModal(modal Modal)
- func (a *App) RefreshAll(onComplete ...func()) bool
- func (a *App) RegisterKeybindings() error
- func (a *App) RegisterMouseBindings()
- func (a *App) RegisterPanel(panel Panel)
- func (a *App) Run() error
- func (a *App) SchemaDiffMigration()
- func (a *App) Studio()
- func (a *App) TestConfirmModal()
- func (a *App) TestInputModal()
- func (a *App) TestListModal()
- func (a *App) TestModal()
- func (a *App) TestPing()
- type AppConfig
- type BasePanel
- type Color
- type ConfirmModal
- type DetailsPanel
- func (d *DetailsPanel) Draw(dim boxlayout.Dimensions) error
- func (d *DetailsPanel) LoadActionNeededData()
- func (d *DetailsPanel) NextTab()
- func (d *DetailsPanel) PrevTab()
- func (d *DetailsPanel) ScrollDown()
- func (d *DetailsPanel) ScrollDownByWheel()
- func (d *DetailsPanel) ScrollToBottom()
- func (d *DetailsPanel) ScrollToTop()
- func (d *DetailsPanel) ScrollUp()
- func (d *DetailsPanel) ScrollUpByWheel()
- func (d *DetailsPanel) SetApp(app *App)
- func (d *DetailsPanel) SetContent(content string)
- func (d *DetailsPanel) UpdateFromMigration(migration *prisma.Migration, tabName string)
- type InputModal
- func (m *InputModal) Draw(dim boxlayout.Dimensions) error
- func (m *InputModal) HandleKey(key any, mod gocui.Modifier) error
- func (m *InputModal) ID() string
- func (m *InputModal) OnClose()
- func (m *InputModal) OnValidationFail(callback func(string)) *InputModal
- func (m *InputModal) WithRequired(required bool) *InputModal
- func (m *InputModal) WithStyle(style MessageModalStyle) *InputModal
- func (m *InputModal) WithSubtitle(subtitle string) *InputModal
- type ListModal
- type ListModalItem
- type MessageModal
- type MessageModalStyle
- type MigrationsPanel
- func (m *MigrationsPanel) Draw(dim boxlayout.Dimensions) error
- func (m *MigrationsPanel) GetCurrentTab() string
- func (m *MigrationsPanel) GetSelectedMigration() *prisma.Migration
- func (m *MigrationsPanel) NextTab()
- func (m *MigrationsPanel) PrevTab()
- func (m *MigrationsPanel) Refresh()
- func (m *MigrationsPanel) ScrollDownByWheel()
- func (m *MigrationsPanel) ScrollToBottom()
- func (m *MigrationsPanel) ScrollToTop()
- func (m *MigrationsPanel) ScrollUpByWheel()
- func (m *MigrationsPanel) SelectNext()
- func (m *MigrationsPanel) SelectPrev()
- func (m *MigrationsPanel) SetApp(app *App)
- func (m *MigrationsPanel) SetDetailsPanel(details *DetailsPanel)
- type Modal
- type OutputPanel
- func (o *OutputPanel) AppendOutput(text string)
- func (o *OutputPanel) Draw(dim boxlayout.Dimensions) error
- func (o *OutputPanel) LogAction(action string, details ...string)
- func (o *OutputPanel) LogActionRed(action string, details ...string)
- func (o *OutputPanel) ScrollDown()
- func (o *OutputPanel) ScrollDownByWheel()
- func (o *OutputPanel) ScrollToBottom()
- func (o *OutputPanel) ScrollToTop()
- func (o *OutputPanel) ScrollUp()
- func (o *OutputPanel) ScrollUpByWheel()
- func (o *OutputPanel) SetSubtitle(subtitle string)
- type Panel
- type StatusBar
- type Style
- type WorkspacePanel
- func (w *WorkspacePanel) Draw(dim boxlayout.Dimensions) error
- func (w *WorkspacePanel) Refresh()
- func (w *WorkspacePanel) ScrollDown()
- func (w *WorkspacePanel) ScrollDownByWheel()
- func (w *WorkspacePanel) ScrollToBottom()
- func (w *WorkspacePanel) ScrollToTop()
- func (w *WorkspacePanel) ScrollUp()
- func (w *WorkspacePanel) ScrollUpByWheel()
Constants ¶
const ( ViewWorkspace = "workspace" ViewMigrations = "migrations" ViewDetails = "details" ViewOutputs = "outputs" ViewStatusbar = "statusbar" )
View identifiers
Variables ¶
var ( PrimaryFrameColor = gocui.ColorWhite FocusedFrameColor = gocui.ColorGreen PrimaryTitleColor = gocui.ColorWhite | gocui.AttrNone FocusedTitleColor = gocui.ColorGreen | gocui.AttrBold // Tab styling FocusedActiveTabColor = gocui.ColorGreen | gocui.AttrBold // Active tab when panel is focused PrimaryActiveTabColor = gocui.ColorGreen | gocui.AttrNone // Active tab when panel is not focused // List selection color SelectionBgColor = gocui.ColorBlue )
Frame and title styling
Functions ¶
func AdjustOrigin ¶
AdjustOrigin adjusts the origin to ensure it's within valid bounds Call this after content is rendered but before SetOrigin
func CopyToClipboard ¶
CopyToClipboard copies text to the system clipboard
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) CloseModal ¶
func (a *App) CloseModal()
CloseModal closes the active modal and restores focus
func (*App) CopyMigrationInfo ¶
func (a *App) CopyMigrationInfo()
CopyMigrationInfo copies migration info to clipboard
func (*App) DeleteMigration ¶
func (a *App) DeleteMigration()
DeleteMigration deletes a pending migration
func (*App) FocusPrevious ¶
func (a *App) FocusPrevious()
func (*App) Generate ¶
func (a *App) Generate()
Generate runs prisma generate and shows result in modal
func (*App) GetCurrentPanel ¶
GetCurrentPanel returns the currently focused panel
func (*App) HasActiveModal ¶
HasActiveModal returns true if a modal is currently active
func (*App) MigrateDeploy ¶
func (a *App) MigrateDeploy()
MigrateDeploy runs npx prisma migrate deploy
func (*App) MigrateDev ¶
func (a *App) MigrateDev()
MigrateDev opens a list modal to choose migration type
func (*App) MigrateResolve ¶
func (a *App) MigrateResolve()
MigrateResolve resolves a failed migration
func (*App) RefreshAll ¶
RefreshAll refreshes all panels asynchronously
func (*App) RegisterKeybindings ¶
func (*App) RegisterMouseBindings ¶
func (a *App) RegisterMouseBindings()
RegisterMouseBindings registers mouse click handlers for all panels
func (*App) RegisterPanel ¶
func (*App) SchemaDiffMigration ¶
func (a *App) SchemaDiffMigration()
SchemaDiffMigration performs schema diff-based migration with validation checks
func (*App) TestConfirmModal ¶
func (a *App) TestConfirmModal()
TestConfirmModal opens a test confirm modal (temporary for testing)
func (*App) TestInputModal ¶
func (a *App) TestInputModal()
TestInputModal opens a test input modal (temporary for testing)
func (*App) TestListModal ¶
func (a *App) TestListModal()
TestListModal opens a test list modal (temporary for testing)
type ConfirmModal ¶
type ConfirmModal struct {
// contains filtered or unexported fields
}
ConfirmModal displays a confirmation dialog with Yes/No options
func NewConfirmModal ¶
func NewConfirmModal(g *gocui.Gui, title string, message string, onYes func(), onNo func()) *ConfirmModal
NewConfirmModal creates a new confirmation modal
func (*ConfirmModal) Draw ¶
func (m *ConfirmModal) Draw(dim boxlayout.Dimensions) error
Draw renders the modal
func (*ConfirmModal) HandleKey ¶
func (m *ConfirmModal) HandleKey(key any, mod gocui.Modifier) error
HandleKey handles keyboard input
func (*ConfirmModal) OnClose ¶
func (m *ConfirmModal) OnClose()
OnClose is called when the modal is closed
func (*ConfirmModal) WithStyle ¶
func (m *ConfirmModal) WithStyle(style MessageModalStyle) *ConfirmModal
WithStyle sets the modal style
type DetailsPanel ¶
type DetailsPanel struct {
BasePanel
// contains filtered or unexported fields
}
func NewDetailsPanel ¶
func NewDetailsPanel(g *gocui.Gui) *DetailsPanel
func (*DetailsPanel) Draw ¶
func (d *DetailsPanel) Draw(dim boxlayout.Dimensions) error
func (*DetailsPanel) LoadActionNeededData ¶
func (d *DetailsPanel) LoadActionNeededData()
LoadActionNeededData loads migrations that require action (Empty + Mismatch) and validates schema
func (*DetailsPanel) PrevTab ¶
func (d *DetailsPanel) PrevTab()
PrevTab switches to the previous tab
func (*DetailsPanel) ScrollDown ¶
func (d *DetailsPanel) ScrollDown()
ScrollDown scrolls the details panel down
func (*DetailsPanel) ScrollDownByWheel ¶
func (d *DetailsPanel) ScrollDownByWheel()
ScrollDownByWheel scrolls the details panel down by 2 lines (mouse wheel)
func (*DetailsPanel) ScrollToBottom ¶
func (d *DetailsPanel) ScrollToBottom()
ScrollToBottom scrolls to the bottom of the details panel
func (*DetailsPanel) ScrollToTop ¶
func (d *DetailsPanel) ScrollToTop()
ScrollToTop scrolls to the top of the details panel
func (*DetailsPanel) ScrollUp ¶
func (d *DetailsPanel) ScrollUp()
ScrollUp scrolls the details panel up
func (*DetailsPanel) ScrollUpByWheel ¶
func (d *DetailsPanel) ScrollUpByWheel()
ScrollUpByWheel scrolls the details panel up by 2 lines (mouse wheel)
func (*DetailsPanel) SetApp ¶
func (d *DetailsPanel) SetApp(app *App)
SetApp sets the app reference for modal checking
func (*DetailsPanel) SetContent ¶
func (d *DetailsPanel) SetContent(content string)
func (*DetailsPanel) UpdateFromMigration ¶
func (d *DetailsPanel) UpdateFromMigration(migration *prisma.Migration, tabName string)
UpdateFromMigration updates the details panel with migration information
type InputModal ¶
type InputModal struct {
// contains filtered or unexported fields
}
InputModal displays an input field for user text entry
func NewInputModal ¶
func NewInputModal(g *gocui.Gui, title string, onSubmit func(string), onCancel func()) *InputModal
NewInputModal creates a new input modal
func (*InputModal) Draw ¶
func (m *InputModal) Draw(dim boxlayout.Dimensions) error
Draw renders the input modal
func (*InputModal) HandleKey ¶
func (m *InputModal) HandleKey(key any, mod gocui.Modifier) error
HandleKey handles keyboard input
func (*InputModal) OnClose ¶
func (m *InputModal) OnClose()
OnClose is called when the modal is closed
func (*InputModal) OnValidationFail ¶
func (m *InputModal) OnValidationFail(callback func(string)) *InputModal
OnValidationFail sets the callback for validation failures
func (*InputModal) WithRequired ¶
func (m *InputModal) WithRequired(required bool) *InputModal
WithRequired sets whether the input is required (non-empty)
func (*InputModal) WithStyle ¶
func (m *InputModal) WithStyle(style MessageModalStyle) *InputModal
WithStyle sets the modal style
func (*InputModal) WithSubtitle ¶
func (m *InputModal) WithSubtitle(subtitle string) *InputModal
WithSubtitle sets the modal subtitle
type ListModal ¶
type ListModal struct {
// contains filtered or unexported fields
}
ListModal displays a list of items with descriptions
func NewListModal ¶
func NewListModal(g *gocui.Gui, title string, items []ListModalItem, onCancel func()) *ListModal
NewListModal creates a new list modal
func (*ListModal) Draw ¶
func (m *ListModal) Draw(dim boxlayout.Dimensions) error
Draw renders the list modal with two views (list on top, description on bottom)
func (*ListModal) OnClose ¶
func (m *ListModal) OnClose()
OnClose is called when the modal is closed
func (*ListModal) WithStyle ¶
func (m *ListModal) WithStyle(style MessageModalStyle) *ListModal
WithStyle sets the modal style
type ListModalItem ¶
type ListModalItem struct {
Label string // Display text in the list
Description string // Description shown in the bottom view
OnSelect func() error // Callback when item is selected with Enter
}
ListModalItem represents a selectable item in the list modal
type MessageModal ¶
type MessageModal struct {
// contains filtered or unexported fields
}
MessageModal displays a message with title and content
func NewMessageModal ¶
func NewMessageModal(g *gocui.Gui, title string, lines ...string) *MessageModal
NewMessageModal creates a new message modal
func (*MessageModal) Draw ¶
func (m *MessageModal) Draw(dim boxlayout.Dimensions) error
Draw renders the modal
func (*MessageModal) HandleKey ¶
func (m *MessageModal) HandleKey(key any, mod gocui.Modifier) error
HandleKey handles keyboard input
func (*MessageModal) OnClose ¶
func (m *MessageModal) OnClose()
OnClose is called when the modal is closed
func (*MessageModal) WithStyle ¶
func (m *MessageModal) WithStyle(style MessageModalStyle) *MessageModal
WithStyle sets the modal style
type MessageModalStyle ¶
type MessageModalStyle struct {
TitleColor Color // Color for title (default: ColorDefault)
BorderColor Color // Color for border (default: ColorDefault)
}
MessageModalStyle holds styling options for the modal
type MigrationsPanel ¶
type MigrationsPanel struct {
BasePanel
// contains filtered or unexported fields
}
func NewMigrationsPanel ¶
func NewMigrationsPanel(g *gocui.Gui) *MigrationsPanel
func (*MigrationsPanel) Draw ¶
func (m *MigrationsPanel) Draw(dim boxlayout.Dimensions) error
func (*MigrationsPanel) GetCurrentTab ¶
func (m *MigrationsPanel) GetCurrentTab() string
GetCurrentTab returns the name of the current tab
func (*MigrationsPanel) GetSelectedMigration ¶
func (m *MigrationsPanel) GetSelectedMigration() *prisma.Migration
GetSelectedMigration returns the currently selected migration
func (*MigrationsPanel) NextTab ¶
func (m *MigrationsPanel) NextTab()
NextTab switches to the next tab
func (*MigrationsPanel) PrevTab ¶
func (m *MigrationsPanel) PrevTab()
PrevTab switches to the previous tab
func (*MigrationsPanel) Refresh ¶
func (m *MigrationsPanel) Refresh()
Refresh reloads all migration data
func (*MigrationsPanel) ScrollDownByWheel ¶
func (m *MigrationsPanel) ScrollDownByWheel()
ScrollDownByWheel scrolls the migrations list down by 2 lines (mouse wheel)
func (*MigrationsPanel) ScrollToBottom ¶
func (m *MigrationsPanel) ScrollToBottom()
ScrollToBottom scrolls to the bottom of the migrations list
func (*MigrationsPanel) ScrollToTop ¶
func (m *MigrationsPanel) ScrollToTop()
ScrollToTop scrolls to the top of the migrations list
func (*MigrationsPanel) ScrollUpByWheel ¶
func (m *MigrationsPanel) ScrollUpByWheel()
ScrollUpByWheel scrolls the migrations list up by 2 lines (mouse wheel)
func (*MigrationsPanel) SelectNext ¶
func (m *MigrationsPanel) SelectNext()
func (*MigrationsPanel) SelectPrev ¶
func (m *MigrationsPanel) SelectPrev()
func (*MigrationsPanel) SetApp ¶
func (m *MigrationsPanel) SetApp(app *App)
SetApp sets the app reference for modal checking
func (*MigrationsPanel) SetDetailsPanel ¶
func (m *MigrationsPanel) SetDetailsPanel(details *DetailsPanel)
SetDetailsPanel sets the details panel reference and performs initial update
type Modal ¶
type Modal interface {
ID() string
Draw(dim boxlayout.Dimensions) error
HandleKey(key any, mod gocui.Modifier) error
OnClose()
}
Modal represents a modal dialog
type OutputPanel ¶
type OutputPanel struct {
BasePanel
// contains filtered or unexported fields
}
func NewOutputPanel ¶
func NewOutputPanel(g *gocui.Gui) *OutputPanel
func (*OutputPanel) AppendOutput ¶
func (o *OutputPanel) AppendOutput(text string)
func (*OutputPanel) Draw ¶
func (o *OutputPanel) Draw(dim boxlayout.Dimensions) error
func (*OutputPanel) LogAction ¶
func (o *OutputPanel) LogAction(action string, details ...string)
LogAction logs an action with timestamp and optional details
func (*OutputPanel) LogActionRed ¶
func (o *OutputPanel) LogActionRed(action string, details ...string)
LogActionRed logs an action in red (for errors/warnings)
func (*OutputPanel) ScrollDown ¶
func (o *OutputPanel) ScrollDown()
ScrollDown scrolls the output panel down
func (*OutputPanel) ScrollDownByWheel ¶
func (o *OutputPanel) ScrollDownByWheel()
ScrollDownByWheel scrolls the output panel down by 2 lines (mouse wheel)
func (*OutputPanel) ScrollToBottom ¶
func (o *OutputPanel) ScrollToBottom()
ScrollToBottom scrolls to the bottom of the output panel
func (*OutputPanel) ScrollToTop ¶
func (o *OutputPanel) ScrollToTop()
ScrollToTop scrolls to the top of the output panel
func (*OutputPanel) ScrollUp ¶
func (o *OutputPanel) ScrollUp()
ScrollUp scrolls the output panel up
func (*OutputPanel) ScrollUpByWheel ¶
func (o *OutputPanel) ScrollUpByWheel()
ScrollUpByWheel scrolls the output panel up by 2 lines (mouse wheel)
func (*OutputPanel) SetSubtitle ¶
func (o *OutputPanel) SetSubtitle(subtitle string)
SetSubtitle sets the custom subtitle for the panel
type Panel ¶
type Panel interface {
ID() string
Draw(dim boxlayout.Dimensions) error
OnFocus()
OnBlur()
}
type Style ¶
type Style struct {
FgColor Color
BgColor Color
Bold bool
Italic bool
Underline bool
Dim bool
Blink bool
Reverse bool
StrikeThru bool
}
Style represents text styling options
type WorkspacePanel ¶
type WorkspacePanel struct {
BasePanel
// contains filtered or unexported fields
}
func NewWorkspacePanel ¶
func NewWorkspacePanel(g *gocui.Gui) *WorkspacePanel
func (*WorkspacePanel) Draw ¶
func (w *WorkspacePanel) Draw(dim boxlayout.Dimensions) error
func (*WorkspacePanel) Refresh ¶
func (w *WorkspacePanel) Refresh()
Refresh reloads all workspace information
func (*WorkspacePanel) ScrollDown ¶
func (w *WorkspacePanel) ScrollDown()
ScrollDown scrolls the workspace panel down
func (*WorkspacePanel) ScrollDownByWheel ¶
func (w *WorkspacePanel) ScrollDownByWheel()
ScrollDownByWheel scrolls the workspace panel down by 2 lines (mouse wheel)
func (*WorkspacePanel) ScrollToBottom ¶
func (w *WorkspacePanel) ScrollToBottom()
ScrollToBottom scrolls to the bottom of the workspace panel
func (*WorkspacePanel) ScrollToTop ¶
func (w *WorkspacePanel) ScrollToTop()
ScrollToTop scrolls to the top of the workspace panel
func (*WorkspacePanel) ScrollUp ¶
func (w *WorkspacePanel) ScrollUp()
ScrollUp scrolls the workspace panel up
func (*WorkspacePanel) ScrollUpByWheel ¶
func (w *WorkspacePanel) ScrollUpByWheel()
ScrollUpByWheel scrolls the workspace panel up by 2 lines (mouse wheel)