Documentation
¶
Overview ¶
Package review implements the diff review panel for grut. It displays changed files with their diffs and supports hunk-level approve/reject decisions for structured code review workflows.
Index ¶
- func GenerateSummary(files []ReviewFile) string
- type HunkState
- type Panel
- func (p *Panel) Init(ctx context.Context) tea.Cmd
- func (p *Panel) KeyBindings() []panels.KeyBinding
- func (p *Panel) SetActionsCfg(cfg config.ActionsConfig)
- func (p *Panel) SetFiles(files []ReviewFile)
- func (p *Panel) Update(msg tea.Msg) (panels.Panel, tea.Cmd)
- func (p *Panel) View(width, height int) string
- type ReviewFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSummary ¶
func GenerateSummary(files []ReviewFile) string
GenerateSummary produces a structured plain-text summary of all review decisions. The output is designed for pasting into PR descriptions or review comments.
Types ¶
type HunkState ¶
type HunkState int
HunkState represents the review decision for a single diff hunk.
type Panel ¶
Panel is the diff review panel. It displays changed files and their diffs, supporting hunk-level approve/reject decisions.
func New ¶
func New(gc gitOps) *Panel
New creates a new review panel with the given git client. gc may be nil; the panel will show an error until a client is available.
func (*Panel) KeyBindings ¶
func (p *Panel) KeyBindings() []panels.KeyBinding
KeyBindings implements panels.Panel.
func (*Panel) SetActionsCfg ¶
func (p *Panel) SetActionsCfg(cfg config.ActionsConfig)
SetActionsCfg stores the actions configuration for right-click menus.
func (*Panel) SetFiles ¶
func (p *Panel) SetFiles(files []ReviewFile)
SetFiles directly injects review file data for testing. It resets cursor positions and rebuilds rendered lines.