From 62eefe88a3cfff27082c8c0a96141e72f9a0858a Mon Sep 17 00:00:00 2001 From: Dolev Hadar Date: Sat, 5 Apr 2025 21:07:55 +0300 Subject: [PATCH 1/5] build: devbox --- .envrc | 9 ++++ devbox.json | 14 +++++ devbox.lock | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 175 insertions(+) create mode 100644 .envrc create mode 100644 devbox.json create mode 100644 devbox.lock diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..2f05af9 --- /dev/null +++ b/.envrc @@ -0,0 +1,9 @@ +#!/bin/bash + +# Automatically sets up your devbox environment whenever you cd into this +# directory via our direnv integration: + +eval "$(devbox generate direnv --print-envrc)" + +# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/ +# for more details diff --git a/devbox.json b/devbox.json new file mode 100644 index 0000000..978b180 --- /dev/null +++ b/devbox.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.0/.schema/devbox.schema.json", + "packages": { + "go": "1.22.6", + "gopls": "latest", + "golangci-lint": "latest" + }, + "shell": { + "scripts": { + "test": ["echo \"Error: no test specified\" && exit 1"] + } + } +} + diff --git a/devbox.lock b/devbox.lock new file mode 100644 index 0000000..6a18528 --- /dev/null +++ b/devbox.lock @@ -0,0 +1,152 @@ +{ + "lockfile_version": "1", + "packages": { + "github:NixOS/nixpkgs/nixpkgs-unstable": { + "resolved": "github:NixOS/nixpkgs/2bfc080955153be0be56724be6fa5477b4eefabb?lastModified=1743689281&narHash=sha256-y7Hg5lwWhEOgflEHRfzSH96BOt26LaYfrYWzZ%2BVoVdg%3D" + }, + "go@1.22.6": { + "last_modified": "2024-08-31T10:12:23Z", + "resolved": "github:NixOS/nixpkgs/5629520edecb69630a3f4d17d3d33fc96c13f6fe#go", + "source": "devbox-search", + "version": "1.22.6", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/bman2jjx2ykfclj3g0wb89cxyzqygh8y-go-1.22.6", + "default": true + } + ], + "store_path": "/nix/store/bman2jjx2ykfclj3g0wb89cxyzqygh8y-go-1.22.6" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/gnm672jywl1b778ql6pf57xka45452b6-go-1.22.6", + "default": true + } + ], + "store_path": "/nix/store/gnm672jywl1b778ql6pf57xka45452b6-go-1.22.6" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/qvr3slzx5av20xkw6i97yz7wla9sf4nc-go-1.22.6", + "default": true + } + ], + "store_path": "/nix/store/qvr3slzx5av20xkw6i97yz7wla9sf4nc-go-1.22.6" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/6rybf4g5b77kz27k07avr7qd44ssw3l2-go-1.22.6", + "default": true + } + ], + "store_path": "/nix/store/6rybf4g5b77kz27k07avr7qd44ssw3l2-go-1.22.6" + } + } + }, + "golangci-lint@latest": { + "last_modified": "2025-03-25T17:32:05Z", + "resolved": "github:NixOS/nixpkgs/25d1b84f5c90632a623c48d83a2faf156451e6b1#golangci-lint", + "source": "devbox-search", + "version": "2.0.0", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/idv9cyl4i6w9n4sgc29kvqhywm04n1rz-golangci-lint-2.0.0", + "default": true + } + ], + "store_path": "/nix/store/idv9cyl4i6w9n4sgc29kvqhywm04n1rz-golangci-lint-2.0.0" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/r0jxwvqvk2999dx04v3j9jgd46jscqc4-golangci-lint-2.0.0", + "default": true + } + ], + "store_path": "/nix/store/r0jxwvqvk2999dx04v3j9jgd46jscqc4-golangci-lint-2.0.0" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/lsyy8arab3zvkpi8lr9303mf88y5k1rc-golangci-lint-2.0.0", + "default": true + } + ], + "store_path": "/nix/store/lsyy8arab3zvkpi8lr9303mf88y5k1rc-golangci-lint-2.0.0" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/834gvbmhpwvy1d65r5x4xihkxm4g91ab-golangci-lint-2.0.0", + "default": true + } + ], + "store_path": "/nix/store/834gvbmhpwvy1d65r5x4xihkxm4g91ab-golangci-lint-2.0.0" + } + } + }, + "gopls@latest": { + "last_modified": "2025-03-25T17:32:05Z", + "resolved": "github:NixOS/nixpkgs/25d1b84f5c90632a623c48d83a2faf156451e6b1#gopls", + "source": "devbox-search", + "version": "0.18.1", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/1yhl06d3rp0v9nzj9w11d91mzdib9li0-gopls-0.18.1", + "default": true + } + ], + "store_path": "/nix/store/1yhl06d3rp0v9nzj9w11d91mzdib9li0-gopls-0.18.1" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/f276ys7dbl1c4h5i3yc1yavwn4vkznpm-gopls-0.18.1", + "default": true + } + ], + "store_path": "/nix/store/f276ys7dbl1c4h5i3yc1yavwn4vkznpm-gopls-0.18.1" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/idmdsky8xd2dcwkiwsxka50lwmp6f9s3-gopls-0.18.1", + "default": true + } + ], + "store_path": "/nix/store/idmdsky8xd2dcwkiwsxka50lwmp6f9s3-gopls-0.18.1" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/2w4s5abaqwm45wkkwwf15yyw5dcrqs7m-gopls-0.18.1", + "default": true + } + ], + "store_path": "/nix/store/2w4s5abaqwm45wkkwwf15yyw5dcrqs7m-gopls-0.18.1" + } + } + } + } +} From ad8e7ae38ff6916248e6c4519ec256fb2edcca73 Mon Sep 17 00:00:00 2001 From: Dolev Hadar Date: Sat, 10 May 2025 20:50:30 +0300 Subject: [PATCH 2/5] fix: go to top of diff when switching files --- pkg/ui/mainModel.go | 2 ++ pkg/ui/panes/diffviewer/diffviewer.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/pkg/ui/mainModel.go b/pkg/ui/mainModel.go index 4d24a3f..2ae11f7 100644 --- a/pkg/ui/mainModel.go +++ b/pkg/ui/mainModel.go @@ -107,11 +107,13 @@ func (m mainModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { cmds = append(cmds, dfCmd) case "up", "k", "ctrl+p": if m.cursor > 0 { + m.diffViewer.GoToTop() cmd = m.setCursor(m.cursor - 1) cmds = append(cmds, cmd) } case "down", "j", "ctrl+n": if m.cursor < len(m.files)-1 { + m.diffViewer.GoToTop() cmd = m.setCursor(m.cursor + 1) cmds = append(cmds, cmd) } diff --git a/pkg/ui/panes/diffviewer/diffviewer.go b/pkg/ui/panes/diffviewer/diffviewer.go index 099e3e0..95648bd 100644 --- a/pkg/ui/panes/diffviewer/diffviewer.go +++ b/pkg/ui/panes/diffviewer/diffviewer.go @@ -112,6 +112,10 @@ func (m Model) SetFilePatch(file *gitdiff.File) (Model, tea.Cmd) { return m, diff(m.file, m.Width) } +func (m *Model) GoToTop() { + m.vp.GotoTop() +} + func diff(file *gitdiff.File, width int) tea.Cmd { if width == 0 || file == nil { return nil From 13232a25e95ebde0590fdfc602962b9cff63c282 Mon Sep 17 00:00:00 2001 From: Dolev Hadar Date: Sat, 10 May 2025 20:57:26 +0300 Subject: [PATCH 3/5] ci: add svu --- devbox.json | 8 ++++---- devbox.lock | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/devbox.json b/devbox.json index 978b180..8957906 100644 --- a/devbox.json +++ b/devbox.json @@ -1,9 +1,10 @@ { "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.0/.schema/devbox.schema.json", "packages": { - "go": "1.22.6", - "gopls": "latest", - "golangci-lint": "latest" + "go": "1.22.6", + "gopls": "latest", + "golangci-lint": "latest", + "svu": "latest" }, "shell": { "scripts": { @@ -11,4 +12,3 @@ } } } - diff --git a/devbox.lock b/devbox.lock index 6a18528..16d1923 100644 --- a/devbox.lock +++ b/devbox.lock @@ -147,6 +147,54 @@ "store_path": "/nix/store/2w4s5abaqwm45wkkwwf15yyw5dcrqs7m-gopls-0.18.1" } } + }, + "svu@latest": { + "last_modified": "2025-04-17T05:47:26Z", + "resolved": "github:NixOS/nixpkgs/ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c#svu", + "source": "devbox-search", + "version": "3.2.3", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/djfi0c8vvpsfssadwls6y55zyhkif58c-svu-3.2.3", + "default": true + } + ], + "store_path": "/nix/store/djfi0c8vvpsfssadwls6y55zyhkif58c-svu-3.2.3" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/2jy02ldq76r8r3slbcc1cb1dbxahraxr-svu-3.2.3", + "default": true + } + ], + "store_path": "/nix/store/2jy02ldq76r8r3slbcc1cb1dbxahraxr-svu-3.2.3" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/jx3ilvqwkcjmfh9kccyx1rbm06lgfa00-svu-3.2.3", + "default": true + } + ], + "store_path": "/nix/store/jx3ilvqwkcjmfh9kccyx1rbm06lgfa00-svu-3.2.3" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "out", + "path": "/nix/store/vmdd4wxfbgp9xiv6icyzsxi36f4i31j8-svu-3.2.3", + "default": true + } + ], + "store_path": "/nix/store/vmdd4wxfbgp9xiv6icyzsxi36f4i31j8-svu-3.2.3" + } + } } } } From 7e51ed93bd02dbfd0cdd2c1683d1d13a0e4a8c8d Mon Sep 17 00:00:00 2001 From: Dolev Hadar Date: Sat, 10 May 2025 20:59:35 +0300 Subject: [PATCH 4/5] ci: add gh-dash.yml --- .gh-dash.yml | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .gh-dash.yml diff --git a/.gh-dash.yml b/.gh-dash.yml new file mode 100644 index 0000000..8c62e1e --- /dev/null +++ b/.gh-dash.yml @@ -0,0 +1,86 @@ +# yaml-language-server: $schema=https://dlvhdr.github.io/diffnav/configuration/gh-dash/schema.json +prSections: + - title: Mine + filters: is:open author:@me repo:dlvhdr/diffnav updated:>={{ nowModify "-3w" }} sort:updated-desc + layout: + author: + hidden: true + - title: Review + filters: repo:dlvhdr/diffnav -author:@me is:open updated:>={{ nowModify "-2.5w" }} + - title: All + filters: repo:dlvhdr/diffnav +issuesSections: + - title: Open + filters: author:@me repo:dlvhdr/diffnav is:open -author:@me sort:reactions + - title: Creator + filters: author:@me repo:dlvhdr/diffnav is:open + - title: All + filters: repo:dlvhdr/diffnav sort:reactions + +pager: + diff: diffnav +defaults: + view: prs + refetchIntervalMinutes: 5 + layout: + prs: + repoName: + grow: true, + width: 10 + hidden: false + base: + hidden: true + + preview: + open: true + width: 84 + prsLimit: 20 + issuesLimit: 20 +repoPaths: + dlvhdr/*: ~/code/personal/* + +keybindings: + universal: + - key: g + name: lazygit + command: > + cd {{.RepoPath}} && lazygit + prs: + - key: O + builtin: checkout + - key: m + command: gh pr merge --admin --repo {{.RepoName}} {{.PrNumber}} + - key: C + name: code review + command: > + tmux new-window -c {{.RepoPath}} ' + nvim -c ":silent Octo pr edit {{.PrNumber}}" + ' + - key: a + name: lazygit add + command: > + cd {{.RepoPath}} && git add -A && lazygit + - key: v + name: approve + command: > + gh pr review --repo {{.RepoName}} --approve --body "$(gum input --prompt='Approval Comment: ')" {{.PrNumber}} + +theme: + ui: + sectionsShowCount: true + table: + compact: false + colors: + text: + primary: "#E2E1ED" + secondary: "#666CA6" + inverted: "#242347" + faint: "#B0B3BF" + warning: "#E0AF68" + success: "#3DF294" + background: + selected: "#1B1B33" + border: + primary: "#383B5B" + secondary: "#39386B" + faint: "#2B2B40" From 3a431deb6cd9d9085b39a60e3c7706c651cc4b60 Mon Sep 17 00:00:00 2001 From: Dolev Hadar <6196971+dlvhdr@users.noreply.github.com> Date: Mon, 22 Sep 2025 13:14:01 +0300 Subject: [PATCH 5/5] chore: add funding configuration for GitHub --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..6e41a4c --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [dlvhdr]