Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.25"
- name: Run Unit tests
run: |
go test -race -covermode atomic -coverprofile=covprofile ./...
Expand All @@ -26,6 +26,6 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22
go-version: "1.25"
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
4 changes: 4 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ linters:
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- goconst
path: _test\.go$
paths:
- third_party$
- builtin$
Expand Down
6 changes: 4 additions & 2 deletions cmd/xc/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const (
paginationPadding = 4
helpPadding = 4
listItemWidth = 20
listItemHeight = 6
listItemHeight = 14
listHeightMargin = 2
)

type taskItem struct {
Expand Down Expand Up @@ -76,6 +77,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.WindowSizeMsg:
m.list.SetWidth(msg.Width)
m.list.SetHeight(msg.Height - listHeightMargin)
return m, nil

case tea.KeyMsg:
Expand Down Expand Up @@ -111,7 +113,7 @@ func interactivePicker(ctx context.Context, tasks []models.Task, dir string) err
for _, t := range tasks {
items = append(items, taskItem{t})
}
l := list.New(items, itemDelegate{}, listItemWidth, listItemHeight+len(tasks))
l := list.New(items, itemDelegate{}, listItemWidth, listItemHeight)
l.Title = "xc: Choose a task"
l.SetShowStatusBar(false)
l.DisableQuitKeybindings()
Expand Down
245 changes: 245 additions & 0 deletions examples/long/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
# Long list

This is a really long list.

## Tasks

### Task1

```bash
echo Task1
```

### Task2

```bash
echo Task2
```

### Task3

```bash
echo Task3
```

### Task4

```bash
echo Task4
```

### Task5

```bash
echo Task5
```

### Task6

```bash
echo Task6
```

### Task7

```bash
echo Task7
```

### Task8

```bash
echo Task8
```

### Task9

```bash
echo Task9
```

### Task10

```bash
echo Task10
```

### Task11

```bash
echo Task11
```

### Task12

```bash
echo Task12
```

### Task13

```bash
echo Task13
```

### Task14

```bash
echo Task14
```

### Task15

```bash
echo Task15
```

### Task16

```bash
echo Task16
```

### Task17

```bash
echo Task17
```

### Task18

```bash
echo Task18
```

### Task19

```bash
echo Task19
```

### Task20

```bash
echo Task20
```

### Task21

```bash
echo Task21
```

### Task22

```bash
echo Task22
```

### Task23

```bash
echo Task23
```

### Task24

```bash
echo Task24
```

### Task25

```bash
echo Task25
```

### Task26

```bash
echo Task26
```

### Task27

```bash
echo Task27
```

### Task28

```bash
echo Task28
```

### Task29

```bash
echo Task29
```

### Task30

```bash
echo Task30
```

### Task31

```bash
echo Task31
```

### Task32

```bash
echo Task32
```

### Task33

```bash
echo Task33
```

### Task34

```bash
echo Task34
```

### Task35

```bash
echo Task35
```

### Task36

```bash
echo Task36
```

### Task37

```bash
echo Task37
```

### Task38

```bash
echo Task38
```

### Task39

```bash
echo Task39
```

### Task40

```bash
echo Task40
```
32 changes: 25 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/25.11";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
};

Expand All @@ -15,14 +15,15 @@
{
defaultPackage = xc;
packages = {
default = xc;
xc = xc;
};
devShells = {
default = pkgs.mkShell {
packages = [ xc ];
};
xc = pkgs.mkShell {
packages = [ xc ];
packages = [
pkgs.go_1_25
pkgs.golangci-lint
];
};
};
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/joerdav/xc

go 1.20
go 1.25

require (
github.com/charmbracelet/bubbles v0.16.1
Expand Down
Loading
Loading