Skip to content

Commit 72f6eb2

Browse files
feat: add configurable pageSize option (#14)
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 <noreply@anthropic.com>
1 parent 79a50cb commit 72f6eb2

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

internal/config/config.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ import (
1111

1212
// Config holds the application configuration
1313
type Config struct {
14-
Roots []string `yaml:"roots"`
15-
Ignore []string `yaml:"ignore"`
16-
Editor string `yaml:"editor"`
14+
Roots []string `yaml:"roots"`
15+
Ignore []string `yaml:"ignore"`
16+
Editor string `yaml:"editor"`
17+
PageSize int `yaml:"pageSize,omitempty"`
1718
}
1819

1920
// defaultConfig returns sensible defaults
@@ -37,7 +38,8 @@ func defaultConfig() *Config {
3738
".venv",
3839
"vendor",
3940
},
40-
Editor: "code",
41+
Editor: "code",
42+
PageSize: 15,
4143
}
4244
}
4345

@@ -63,6 +65,11 @@ func Load(path string) (*Config, error) {
6365
cfg.Roots[i] = expandPath(root)
6466
}
6567

68+
// Ensure pageSize has a sensible value
69+
if cfg.PageSize <= 0 {
70+
cfg.PageSize = 15
71+
}
72+
6673
return cfg, nil
6774
}
6875

internal/tui/model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func NewModel(cfg *config.Config) Model {
147147
sortMode: SortByDirty,
148148
filterMode: FilterAll,
149149
currentPage: 0,
150-
pageSize: 15,
150+
pageSize: cfg.PageSize,
151151
}
152152
}
153153

0 commit comments

Comments
 (0)