From 3fedd55c1c5cbaee4fd3c7eb1ad11b3b75499e1e Mon Sep 17 00:00:00 2001 From: Curtis Date: Tue, 27 Jan 2026 12:03:58 -0600 Subject: [PATCH] feat: add configurable pageSize option Allow users to customize the number of repos displayed per page via config: # ~/.config/git-scope/config.yml pageSize: 25 - Add PageSize field to Config struct with yaml tag - Default remains 15 if not specified or set to 0 - Model now reads pageSize from config instead of hardcoded value Co-Authored-By: Claude Opus 4.5 --- internal/config/config.go | 15 +++++++++++---- internal/tui/model.go | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 2feb97d..1832429 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -11,9 +11,10 @@ import ( // Config holds the application configuration type Config struct { - Roots []string `yaml:"roots"` - Ignore []string `yaml:"ignore"` - Editor string `yaml:"editor"` + Roots []string `yaml:"roots"` + Ignore []string `yaml:"ignore"` + Editor string `yaml:"editor"` + PageSize int `yaml:"pageSize,omitempty"` } // defaultConfig returns sensible defaults @@ -37,7 +38,8 @@ func defaultConfig() *Config { ".venv", "vendor", }, - Editor: "code", + Editor: "code", + PageSize: 15, } } @@ -63,6 +65,11 @@ func Load(path string) (*Config, error) { cfg.Roots[i] = expandPath(root) } + // Ensure pageSize has a sensible value + if cfg.PageSize <= 0 { + cfg.PageSize = 15 + } + return cfg, nil } diff --git a/internal/tui/model.go b/internal/tui/model.go index 2bb0dd1..49210cc 100644 --- a/internal/tui/model.go +++ b/internal/tui/model.go @@ -147,7 +147,7 @@ func NewModel(cfg *config.Config) Model { sortMode: SortByDirty, filterMode: FilterAll, currentPage: 0, - pageSize: 15, + pageSize: cfg.PageSize, } }