Compare commits

...
45 Commits
Author SHA1 Message Date
github-actions[bot]andGitHub 192a7610f5 chore(deps): update module charm.land/bubbletea/v2 to v2.1.1
Automated dependency update. All tests passed.
2026-10-31 03:02:37 +00:00
github-actions[bot]andGitHub 11de284eb9 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-10-11 03:08:20 +00:00
github-actions[bot]andGitHub 9276ddcff6 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-10-10 03:06:45 +00:00
lukaszraczylo 22f8f7a008 refactor(tui): move to Bubble Tea, Lip Gloss and Bubbles v2
Switch imports to the charm.land v2 modules. Return tea.View from Model.View,
set alt screen and window title there, use KeyPressMsg and the "space" key
name, and call SetWidth on text inputs.
2026-10-04 10:12:33 +01:00
github-actions[bot]andGitHub 750e43501c chore(deps): update module github.com/stretchr/testify to v1.12.1
Automated dependency update. All tests passed.
2026-10-04 03:59:03 +00:00
lukaszraczylo 5bc0a13c37 ci(deps): update dependencies with Renovate [skip ci] 2026-10-03 18:44:49 +01:00
lukaszraczyloandGitHub b61c42f6e2 Update go.mod and go.sum (#53) 2026-10-03 04:11:47 +01:00
lukaszraczyloandGitHub fcc7ab664f Update go.mod and go.sum (#52) 2026-09-14 04:01:22 +01:00
lukaszraczyloandGitHub 2c2ab03feb Update go.mod and go.sum (#51) 2026-09-11 04:00:59 +01:00
lukaszraczyloandGitHub cf549ae2f6 Update go.mod and go.sum (#50) 2026-09-09 04:01:22 +01:00
lukaszraczyloandGitHub c57042cfe1 Update go.mod and go.sum (#49) 2026-09-02 04:02:54 +01:00
lukaszraczyloandGitHub 3c72c04a2b Update go.mod and go.sum (#48) 2026-08-18 04:14:52 +01:00
lukaszraczyloandGitHub d4ea0ee24b Update go.mod and go.sum (#47) 2026-08-12 04:40:47 +01:00
lukaszraczyloandGitHub a9dbce18be Update go.mod and go.sum (#46) 2026-08-11 04:29:44 +01:00
lukaszraczyloandGitHub 4b3c89860b Update go.mod and go.sum (#45) 2026-08-03 07:00:09 +01:00
lukaszraczyloandGitHub 693e72b21a Update go.mod and go.sum (#44) 2026-07-24 06:37:57 +01:00
lukaszraczyloandGitHub f05feed5dd Update go.mod and go.sum (#43) 2026-07-17 06:29:48 +01:00
lukaszraczyloandGitHub 7ed6ebbd03 Update go.mod and go.sum (#42) 2026-07-09 05:17:35 +01:00
lukaszraczyloandGitHub 276437fc58 Update go.mod and go.sum (#41) 2026-07-07 05:18:55 +01:00
lukaszraczyloandGitHub 538d6daf57 Update go.mod and go.sum (#40) 2026-06-09 05:22:29 +01:00
lukaszraczyloandGitHub 1e697c527f Update go.mod and go.sum (#39) 2026-05-31 05:27:40 +01:00
lukaszraczyloandGitHub 765150d70f Update go.mod and go.sum (#38) 2026-05-30 05:19:36 +01:00
lukaszraczyloandGitHub 190a30f46f Update go.mod and go.sum (#37) 2026-05-23 05:14:26 +01:00
lukaszraczyloandGitHub 7df420f77a Update go.mod and go.sum (#36) 2026-05-22 05:25:00 +01:00
lukaszraczyloandGitHub af378eee42 Update go.mod and go.sum (#35) 2026-05-21 05:27:34 +01:00
lukaszraczylo e8f30bae2c docs: add Telemetry section linking to oss-telemetry opt-out docs
Discloses the single anonymous adoption ping sent on startup and points
users to the upstream README section for full opt-out instructions
instead of duplicating the table here.
2026-05-21 04:06:34 +01:00
lukaszraczylo a2970a58df feat: anonymous usage telemetry via oss-telemetry
Send a single fire-and-forget ping at startup to help track adoption
and version spread. No persistent identifiers are collected.

Opt out via any of:
  DO_NOT_TRACK=1
  OSS_TELEMETRY_DISABLED=1
  LOLCATHOST_DISABLE_TELEMETRY=1
2026-05-21 03:05:06 +01:00
lukaszraczyloandGitHub a791fe688d Update go.mod and go.sum (#34) 2026-05-09 05:06:48 +01:00
lukaszraczyloandGitHub 918db31fb2 Update go.mod and go.sum (#33) 2026-05-05 05:01:35 +01:00
lukaszraczyloandGitHub dfbc6d9fb3 Update go.mod and go.sum (#32) 2026-04-30 05:12:31 +01:00
lukaszraczyloandGitHub 4a592b31df Update go.mod and go.sum (#31) 2026-04-27 05:10:21 +01:00
lukaszraczyloandGitHub dae4d893e5 Update go.mod and go.sum (#30) 2026-04-14 04:59:52 +01:00
lukaszraczyloandGitHub df82bddac5 Update go.mod and go.sum (#29) 2026-04-10 04:59:04 +01:00
lukaszraczyloandGitHub 04f51fb2a9 Update go.mod and go.sum (#28) 2026-04-09 04:54:52 +01:00
lukaszraczyloandGitHub e005c0457c Update go.mod and go.sum (#27) 2026-04-03 04:53:34 +01:00
lukaszraczyloandGitHub 8f56df9a8d Update go.mod and go.sum (#26) 2026-03-29 04:57:32 +01:00
lukaszraczyloandGitHub 6a2394a598 Update go.mod and go.sum (#25) 2026-03-12 03:45:07 +00:00
lukaszraczyloandGitHub 3c18f25a82 Update go.mod and go.sum (#24) 2026-03-10 03:43:17 +00:00
lukaszraczyloandGitHub 0c97ee1a58 Update go.mod and go.sum (#23) 2026-03-09 03:45:32 +00:00
lukaszraczyloandGitHub f1d232a9a6 Update go.mod and go.sum (#22) 2026-03-08 03:44:15 +00:00
lukaszraczyloandGitHub aa414bc2b3 Update go.mod and go.sum (#21) 2026-02-23 03:48:51 +00:00
lukaszraczyloandGitHub 62c844b22c Update go.mod and go.sum (#20) 2026-02-18 03:48:14 +00:00
lukaszraczyloandGitHub c6e1207901 Update go.mod and go.sum (#19) 2026-02-17 03:46:48 +00:00
lukaszraczyloandGitHub 9551b89082 Update go.mod and go.sum (#18) 2026-02-13 03:49:15 +00:00
lukaszraczyloandGitHub 4b808599ac Update go.mod and go.sum (#17) 2026-02-11 03:55:02 +00:00
13 changed files with 160 additions and 129 deletions
+7 -6
View File
@@ -1,4 +1,4 @@
name: Autoupdate go.mod and go.sum name: Update dependencies
on: on:
workflow_dispatch: workflow_dispatch:
@@ -6,14 +6,15 @@ on:
- cron: "0 3 * * *" - cron: "0 3 * * *"
permissions: permissions:
contents: write
actions: write actions: write
contents: write
issues: write
pull-requests: write pull-requests: write
jobs: jobs:
autoupdate: update:
uses: lukaszraczylo/shared-actions/.github/workflows/go-autoupdate.yaml@main uses: lukaszraczylo/shared-actions/.github/workflows/renovate-autoupdate.yaml@main
with: with:
go-version: ">=1.24" go-version: ">=1.24"
release-workflow: "release.yml" node: false
secrets: inherit release-workflow: release.yml
+12
View File
@@ -337,6 +337,18 @@ internal/
version/ - Update checker version/ - Update checker
``` ```
## Telemetry
On startup this binary sends a single anonymous adoption ping — project name,
version, timestamp; no identifiers, no command output, no payload contents.
Fire-and-forget with a 2-second timeout; cannot block startup or panic.
See **[oss-telemetry — Disabling telemetry](https://github.com/lukaszraczylo/oss-telemetry#disabling-telemetry)**
for the exact wire format, source, and full opt-out documentation.
Quick opt-out: set any of `DO_NOT_TRACK=1`, `OSS_TELEMETRY_DISABLED=1`,
or `LOLCATHOST_DISABLE_TELEMETRY=1`.
## License ## License
MIT License - see [LICENSE](LICENSE). MIT License - see [LICENSE](LICENSE).
+3
View File
@@ -16,6 +16,7 @@ import (
"github.com/lukaszraczylo/lolcathost/internal/protocol" "github.com/lukaszraczylo/lolcathost/internal/protocol"
"github.com/lukaszraczylo/lolcathost/internal/tui" "github.com/lukaszraczylo/lolcathost/internal/tui"
"github.com/lukaszraczylo/lolcathost/internal/version" "github.com/lukaszraczylo/lolcathost/internal/version"
telemetry "github.com/lukaszraczylo/oss-telemetry"
) )
// version is set at compile time via ldflags // version is set at compile time via ldflags
@@ -27,6 +28,8 @@ const (
) )
func main() { func main() {
telemetry.Send("lolcathost", appVersion)
// Flags // Flags
daemonMode := flag.Bool("daemon", false, "Run as daemon (called by LaunchDaemon/systemd)") daemonMode := flag.Bool("daemon", false, "Run as daemon (called by LaunchDaemon/systemd)")
installFlag := flag.Bool("install", false, "Install the daemon service (requires sudo)") installFlag := flag.Bool("install", false, "Install the daemon service (requires sudo)")
+20 -24
View File
@@ -1,37 +1,33 @@
module github.com/lukaszraczylo/lolcathost module github.com/lukaszraczylo/lolcathost
go 1.24.2 go 1.26.0
require ( require (
github.com/charmbracelet/bubbles v0.21.1 charm.land/bubbles/v2 v2.2.1
github.com/charmbracelet/bubbletea v1.3.10 charm.land/bubbletea/v2 v2.1.1
github.com/charmbracelet/lipgloss v1.1.0 charm.land/lipgloss/v2 v2.0.6
github.com/fsnotify/fsnotify v1.9.0 github.com/fsnotify/fsnotify v1.10.1
github.com/stretchr/testify v1.11.1 github.com/lukaszraczylo/oss-telemetry v0.2.5
golang.org/x/sys v0.41.0 github.com/stretchr/testify v1.12.1
golang.org/x/sys v0.49.0
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
) )
require ( require (
github.com/atotto/clipboard v0.1.4 // indirect github.com/atotto/clipboard v0.1.4 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/charmbracelet/colorprofile v0.4.3 // indirect
github.com/charmbracelet/colorprofile v0.4.1 // indirect github.com/charmbracelet/ultraviolet v0.0.0-20261008173134-6b8d4baf91b4 // indirect
github.com/charmbracelet/x/ansi v0.11.6 // indirect github.com/charmbracelet/x/ansi v0.11.9 // indirect
github.com/charmbracelet/x/cellbuf v0.0.15 // indirect
github.com/charmbracelet/x/term v0.2.2 // indirect github.com/charmbracelet/x/term v0.2.2 // indirect
github.com/clipperhouse/displaywidth v0.10.0 // indirect github.com/charmbracelet/x/termios v0.1.1 // indirect
github.com/clipperhouse/uax29/v2 v2.6.0 // indirect github.com/charmbracelet/x/windows v0.2.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/clipperhouse/displaywidth v0.11.0 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect github.com/lucasb-eyer/go-colorful v1.4.1 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.31 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.19 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect github.com/rivo/uniseg v0.4.7 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect github.com/xo/terminfo v1.2.0 // indirect
golang.org/x/text v0.34.0 // indirect go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/sync v0.24.0 // indirect
) )
+42 -54
View File
@@ -1,65 +1,53 @@
charm.land/bubbles/v2 v2.2.1 h1:Fq1+qm5hV6GkvzLQDhCBpXXE5tLgvh1PRriCLwSvIQU=
charm.land/bubbles/v2 v2.2.1/go.mod h1:wdMgn+sje1KNXdwFizIWjbf328fIUBxqEmJ/vYPo8yc=
charm.land/bubbletea/v2 v2.1.1 h1:S1S9l37pCZGrj1JexBcr9x4Nr3MVeM42InqCYM/tDpU=
charm.land/bubbletea/v2 v2.1.1/go.mod h1:xWHeyxIX9/wiFU2kgPW04ojOZyTzrWf+8lGjUCaftiU=
charm.land/lipgloss/v2 v2.0.6 h1:EaGKeuA8FvF+v2BT5VmZd2LoYLaMZJXA5n34th8nCIQ=
charm.land/lipgloss/v2 v2.0.6/go.mod h1:ipDDJNSGa1hlwDtSfW1s2/xR8Vdhbut4PXh2zEKZd0Q=
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-udiff v0.4.1 h1:OEIrQ8maEeDBXQDoGCbbTTXYJMYRCRO1fnodZ12Gv5o=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/aymanbagabas/go-udiff v0.4.1/go.mod h1:0L9PGwj20lrtmEMeyw4WKJ/TMyDtvAoK9bf2u/mNo3w=
github.com/aymanbagabas/go-udiff v0.3.1 h1:LV+qyBQ2pqe0u42ZsUEtPiCaUoqgA9gYRDs3vj1nolY= github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex9t5KX76i20Q=
github.com/aymanbagabas/go-udiff v0.3.1/go.mod h1:G0fsKmG+P6ylD0r6N/KgQD/nWzgfnl8ZBcNLgcbrw8E= github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q=
github.com/charmbracelet/bubbles v0.21.1 h1:nj0decPiixaZeL9diI4uzzQTkkz1kYY8+jgzCZXSmW0= github.com/charmbracelet/ultraviolet v0.0.0-20261008173134-6b8d4baf91b4 h1:hISLzUbwcvJbGoNR6A3L/TpguRRnACBmZOee8LcHLJw=
github.com/charmbracelet/bubbles v0.21.1/go.mod h1:HHvIYRCpbkCJw2yo0vNX1O5loCwSr9/mWS8GYSg50Sk= github.com/charmbracelet/ultraviolet v0.0.0-20261008173134-6b8d4baf91b4/go.mod h1:aJDVk+WOVM1K04rdc/71PMPoUGfjxjhvXfP3Pjz1Zio=
github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw= github.com/charmbracelet/x/ansi v0.11.9 h1:kIrqLBxtTVbLyyHO2Evoi93EjQo1mylWmpNEsfPxXAM=
github.com/charmbracelet/bubbletea v1.3.10/go.mod h1:ORQfo0fk8U+po9VaNvnV95UPWA1BitP1E0N6xJPlHr4= github.com/charmbracelet/x/ansi v0.11.9/go.mod h1:DG/hpOnaI2QJ/KMMqLL2h0KVhluuJLazf8973P+Vy5w=
github.com/charmbracelet/colorprofile v0.4.1 h1:a1lO03qTrSIRaK8c3JRxJDZOvhvIeSco3ej+ngLk1kk= github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f h1:pk6gmGpCE7F3FcjaOEKYriCvpmIN4+6OS/RD0vm4uIA=
github.com/charmbracelet/colorprofile v0.4.1/go.mod h1:U1d9Dljmdf9DLegaJ0nGZNJvoXAhayhmidOdcBwAvKk= github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f/go.mod h1:IfZAMTHB6XkZSeXUqriemErjAWCCzT0LwjKFYCZyw0I=
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8=
github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ=
github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI=
github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q=
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payRxjMjKgx2PaCWLZ4p3ro9y97+TVLZNaRZgJwSVDQ=
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk=
github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI= github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI=
github.com/clipperhouse/displaywidth v0.10.0 h1:GhBG8WuerxjFQQYeuZAeVTuyxuX+UraiZGD4HJQ3Y8g= github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY=
github.com/clipperhouse/displaywidth v0.10.0/go.mod h1:XqJajYsaiEwkxOj4bowCTMcT1SgvHo9flfF3jQasdbs= github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo=
github.com/clipperhouse/uax29/v2 v2.6.0 h1:z0cDbUV+aPASdFb2/ndFnS9ts/WNXgTNNGFoKXuhpos= github.com/charmbracelet/x/windows v0.2.2 h1:IofanmuvaxnKHuV04sC0eBy/smG6kIKrWG2/jYn2GuM=
github.com/clipperhouse/uax29/v2 v2.6.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsVRgg6W7ihQeh4g= github.com/charmbracelet/x/windows v0.2.2/go.mod h1:/8XtdKZzedat74NQFn0NGlGL4soHB0YQZrETF96h75k=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0=
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
github.com/lucasb-eyer/go-colorful v1.3.0 h1:2/yBRLdWBZKrf7gB40FoiKfAWYQ0lqNcbuQwVHXptag= github.com/lucasb-eyer/go-colorful v1.4.1 h1:1EO+WB73+EH8EVbzlrG3KLAfEypQWVHIBqlTf+2hNss=
github.com/lucasb-eyer/go-colorful v1.3.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lucasb-eyer/go-colorful v1.4.1/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/lukaszraczylo/oss-telemetry v0.2.5 h1:W6Qgwp7IY4yBRO361MmnEAmM59motdQpbAFAx8v6fJM=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/lukaszraczylo/oss-telemetry v0.2.5/go.mod h1:+Cn78qZo8rc3T9eZt0v3oICYRdd75wORtSidc8lNjDQ=
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-runewidth v0.0.31 h1:1oCV4ReTlosDBc6rYRw5cL8S/4y8iv5oRl4SJ5IBgwo=
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.31/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8=
github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw=
github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v1.2.0 h1:d0ZTOCpuGE0lwSAOs0zcJjwz3jWQyqcRt9XbGJpCOl4=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/xo/terminfo v1.2.0/go.mod h1:lGzkSo8Fe7IRh/w+Gqz7n5mDog4FVXCj3gy/DYTBqio=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA=
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+35 -29
View File
@@ -7,9 +7,9 @@ import (
"strings" "strings"
"time" "time"
"github.com/charmbracelet/bubbles/textinput" "charm.land/bubbles/v2/textinput"
tea "github.com/charmbracelet/bubbletea" tea "charm.land/bubbletea/v2"
"github.com/charmbracelet/lipgloss" "charm.land/lipgloss/v2"
"github.com/lukaszraczylo/lolcathost/internal/client" "github.com/lukaszraczylo/lolcathost/internal/client"
"github.com/lukaszraczylo/lolcathost/internal/config" "github.com/lukaszraczylo/lolcathost/internal/config"
@@ -143,7 +143,7 @@ func NewModel(socketPath string) *Model {
searchInput := textinput.New() searchInput := textinput.New()
searchInput.Placeholder = "Search..." searchInput.Placeholder = "Search..."
searchInput.CharLimit = 100 searchInput.CharLimit = 100
searchInput.Width = 50 searchInput.SetWidth(50)
return &Model{ return &Model{
client: client.New(socketPath), client: client.New(socketPath),
@@ -161,7 +161,6 @@ func NewModel(socketPath string) *Model {
func (m *Model) Init() tea.Cmd { func (m *Model) Init() tea.Cmd {
return tea.Batch( return tea.Batch(
m.connect(), m.connect(),
tea.SetWindowTitle("lolcathost"),
m.tick(), m.tick(),
m.checkForUpdate(), m.checkForUpdate(),
) )
@@ -330,9 +329,9 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if searchWidth > 60 { if searchWidth > 60 {
searchWidth = 60 searchWidth = 60
} }
m.searchInput.Width = searchWidth m.searchInput.SetWidth(searchWidth)
case tea.KeyMsg: case tea.KeyPressMsg:
cmd := m.handleKey(msg) cmd := m.handleKey(msg)
if cmd != nil { if cmd != nil {
cmds = append(cmds, cmd) cmds = append(cmds, cmd)
@@ -505,7 +504,7 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, tea.Batch(cmds...) return m, tea.Batch(cmds...)
} }
func (m *Model) handleKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleKey(msg tea.KeyPressMsg) tea.Cmd {
// Global keys // Global keys
switch msg.String() { switch msg.String() {
case "ctrl+c": case "ctrl+c":
@@ -535,7 +534,7 @@ func (m *Model) handleKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handleListKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleListKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "q": case "q":
return tea.Quit return tea.Quit
@@ -549,7 +548,7 @@ func (m *Model) handleListKey(msg tea.KeyMsg) tea.Cmd {
m.list.MoveUp() m.list.MoveUp()
case "down", "j": case "down", "j":
m.list.MoveDown() m.list.MoveDown()
case " ", "enter": case "space", "enter":
return m.toggleSelected() return m.toggleSelected()
case "n": case "n":
m.mode = ViewForm m.mode = ViewForm
@@ -587,7 +586,7 @@ func (m *Model) handleListKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handleFormKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleFormKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "esc": case "esc":
m.mode = ViewList m.mode = ViewList
@@ -615,7 +614,7 @@ func (m *Model) handleFormKey(msg tea.KeyMsg) tea.Cmd {
return m.form.Update(msg) return m.form.Update(msg)
} }
func (m *Model) handlePresetKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handlePresetKey(msg tea.KeyPressMsg) tea.Cmd {
// Handle based on preset picker mode // Handle based on preset picker mode
switch m.presetPicker.Mode() { switch m.presetPicker.Mode() {
case PresetModeSelect: case PresetModeSelect:
@@ -630,7 +629,7 @@ func (m *Model) handlePresetKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handlePresetSelectKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handlePresetSelectKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "esc", "q": case "esc", "q":
m.mode = ViewList m.mode = ViewList
@@ -652,7 +651,7 @@ func (m *Model) handlePresetSelectKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handlePresetFormKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handlePresetFormKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "esc": case "esc":
m.presetPicker.CancelForm() m.presetPicker.CancelForm()
@@ -690,7 +689,7 @@ func (m *Model) handlePresetFormKey(msg tea.KeyMsg) tea.Cmd {
return m.presetPicker.Update(msg) return m.presetPicker.Update(msg)
} }
func (m *Model) handlePresetPickerKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handlePresetPickerKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "esc": case "esc":
m.presetPicker.ClosePicker() m.presetPicker.ClosePicker()
@@ -700,13 +699,13 @@ func (m *Model) handlePresetPickerKey(msg tea.KeyMsg) tea.Cmd {
m.presetPicker.PickerMoveUp() m.presetPicker.PickerMoveUp()
case "down", "j": case "down", "j":
m.presetPicker.PickerMoveDown() m.presetPicker.PickerMoveDown()
case " ": case "space":
m.presetPicker.TogglePickerSelection() m.presetPicker.TogglePickerSelection()
} }
return nil return nil
} }
func (m *Model) handlePresetDeleteKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handlePresetDeleteKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "y", "Y": case "y", "Y":
if preset := m.presetPicker.Selected(); preset != "" { if preset := m.presetPicker.Selected(); preset != "" {
@@ -719,7 +718,7 @@ func (m *Model) handlePresetDeleteKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handleGroupKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleGroupKey(msg tea.KeyPressMsg) tea.Cmd {
// Handle based on group picker mode // Handle based on group picker mode
switch m.groupPicker.Mode() { switch m.groupPicker.Mode() {
case GroupModeSelect: case GroupModeSelect:
@@ -732,7 +731,7 @@ func (m *Model) handleGroupKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handleGroupSelectKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleGroupSelectKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "esc", "q": case "esc", "q":
m.mode = ViewList m.mode = ViewList
@@ -750,7 +749,7 @@ func (m *Model) handleGroupSelectKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handleGroupFormKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleGroupFormKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "esc": case "esc":
m.groupPicker.CancelForm() m.groupPicker.CancelForm()
@@ -770,7 +769,7 @@ func (m *Model) handleGroupFormKey(msg tea.KeyMsg) tea.Cmd {
return m.groupPicker.Update(msg) return m.groupPicker.Update(msg)
} }
func (m *Model) handleGroupDeleteKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleGroupDeleteKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "y", "Y": case "y", "Y":
if group := m.groupPicker.Selected(); group != "" { if group := m.groupPicker.Selected(); group != "" {
@@ -783,7 +782,7 @@ func (m *Model) handleGroupDeleteKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handleBackupKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleBackupKey(msg tea.KeyPressMsg) tea.Cmd {
switch m.backupPicker.Mode() { switch m.backupPicker.Mode() {
case BackupModeSelect: case BackupModeSelect:
return m.handleBackupSelectKey(msg) return m.handleBackupSelectKey(msg)
@@ -793,7 +792,7 @@ func (m *Model) handleBackupKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handleBackupSelectKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleBackupSelectKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "esc", "q": case "esc", "q":
m.mode = ViewList m.mode = ViewList
@@ -821,7 +820,7 @@ func (m *Model) handleBackupSelectKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handleBackupRestoreKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleBackupRestoreKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "y", "Y": case "y", "Y":
if backup := m.backupPicker.Selected(); backup != "" { if backup := m.backupPicker.Selected(); backup != "" {
@@ -834,7 +833,7 @@ func (m *Model) handleBackupRestoreKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handleHelpKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleHelpKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "esc", "q", "?": case "esc", "q", "?":
m.mode = ViewList m.mode = ViewList
@@ -842,7 +841,7 @@ func (m *Model) handleHelpKey(msg tea.KeyMsg) tea.Cmd {
return nil return nil
} }
func (m *Model) handleSearchKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleSearchKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "esc": case "esc":
m.mode = ViewList m.mode = ViewList
@@ -860,7 +859,7 @@ func (m *Model) handleSearchKey(msg tea.KeyMsg) tea.Cmd {
return cmd return cmd
} }
func (m *Model) handleConfirmDeleteKey(msg tea.KeyMsg) tea.Cmd { func (m *Model) handleConfirmDeleteKey(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "y", "Y": case "y", "Y":
alias := m.pendingDeleteAlias alias := m.pendingDeleteAlias
@@ -900,7 +899,14 @@ func (m *Model) setSuccess(msg string) {
} }
// View renders the UI. // View renders the UI.
func (m *Model) View() string { func (m *Model) View() tea.View {
v := tea.NewView(m.render())
v.AltScreen = true
v.WindowTitle = "lolcathost"
return v
}
func (m *Model) render() string {
var sb strings.Builder var sb strings.Builder
// Title with version // Title with version
@@ -1142,7 +1148,7 @@ func RunWithVersion(socketPath, version, githubOwner, githubRepo string) error {
m.version = version m.version = version
m.githubOwner = githubOwner m.githubOwner = githubOwner
m.githubRepo = githubRepo m.githubRepo = githubRepo
p := tea.NewProgram(m, tea.WithAltScreen()) p := tea.NewProgram(m)
_, err := p.Run() _, err := p.Run()
return err return err
+25
View File
@@ -0,0 +1,25 @@
package tui
import (
"testing"
tea "charm.land/bubbletea/v2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestModel_View_UsesAltScreenAndTitle(t *testing.T) {
m := NewModel("/nonexistent.sock")
v := m.View()
assert.True(t, v.AltScreen)
assert.Equal(t, "lolcathost", v.WindowTitle)
assert.Contains(t, v.Content, "lolcathost - Host Management")
}
func TestModel_SpaceKeyIsNamedSpace(t *testing.T) {
msg := tea.KeyPressMsg{Code: tea.KeySpace, Text: " "}
require.Equal(t, "space", msg.String())
}
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/charmbracelet/lipgloss" "charm.land/lipgloss/v2"
"github.com/lukaszraczylo/lolcathost/internal/protocol" "github.com/lukaszraczylo/lolcathost/internal/protocol"
) )
+4 -4
View File
@@ -5,8 +5,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/charmbracelet/bubbles/textinput" "charm.land/bubbles/v2/textinput"
tea "github.com/charmbracelet/bubbletea" tea "charm.land/bubbletea/v2"
"github.com/lukaszraczylo/lolcathost/internal/config" "github.com/lukaszraczylo/lolcathost/internal/config"
) )
@@ -127,14 +127,14 @@ func (f *Form) SetSize(width, height int) {
inputWidth := min(50, width-10) inputWidth := min(50, width-10)
for i := range f.fields { for i := range f.fields {
f.fields[i].Width = inputWidth f.fields[i].SetWidth(inputWidth)
} }
} }
// Update handles input events. // Update handles input events.
func (f *Form) Update(msg tea.Msg) tea.Cmd { func (f *Form) Update(msg tea.Msg) tea.Cmd {
switch msg := msg.(type) { switch msg := msg.(type) {
case tea.KeyMsg: case tea.KeyPressMsg:
// Handle group dropdown navigation // Handle group dropdown navigation
if f.focus == FieldGroup { if f.focus == FieldGroup {
switch msg.String() { switch msg.String() {
+4 -4
View File
@@ -4,8 +4,8 @@ package tui
import ( import (
"strings" "strings"
"github.com/charmbracelet/bubbles/textinput" "charm.land/bubbles/v2/textinput"
tea "github.com/charmbracelet/bubbletea" tea "charm.land/bubbletea/v2"
) )
// GroupMode represents the group view mode. // GroupMode represents the group view mode.
@@ -53,7 +53,7 @@ func (g *GroupPicker) SetGroups(groups []string) {
func (g *GroupPicker) SetSize(width, height int) { func (g *GroupPicker) SetSize(width, height int) {
g.width = width g.width = width
g.height = height g.height = height
g.input.Width = min(50, width-10) g.input.SetWidth(min(50, width-10))
} }
// MoveUp moves the cursor up. // MoveUp moves the cursor up.
@@ -126,7 +126,7 @@ func (g *GroupPicker) CancelForm() {
} }
// Update handles input events for form mode. // Update handles input events for form mode.
func (g *GroupPicker) Update(msg tea.KeyMsg) tea.Cmd { func (g *GroupPicker) Update(msg tea.KeyPressMsg) tea.Cmd {
var cmd tea.Cmd var cmd tea.Cmd
g.input, cmd = g.input.Update(msg) g.input, cmd = g.input.Update(msg)
return cmd return cmd
+2 -2
View File
@@ -5,8 +5,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/charmbracelet/lipgloss" "charm.land/lipgloss/v2"
"github.com/charmbracelet/lipgloss/table" "charm.land/lipgloss/v2/table"
"github.com/lukaszraczylo/lolcathost/internal/protocol" "github.com/lukaszraczylo/lolcathost/internal/protocol"
) )
+4 -4
View File
@@ -4,8 +4,8 @@ package tui
import ( import (
"strings" "strings"
"github.com/charmbracelet/bubbles/textinput" "charm.land/bubbles/v2/textinput"
tea "github.com/charmbracelet/bubbletea" tea "charm.land/bubbletea/v2"
"github.com/lukaszraczylo/lolcathost/internal/protocol" "github.com/lukaszraczylo/lolcathost/internal/protocol"
) )
@@ -108,7 +108,7 @@ func (p *PresetPicker) SetSize(width, height int) {
inputWidth := min(60, width-10) inputWidth := min(60, width-10)
for i := range p.fields { for i := range p.fields {
p.fields[i].Width = inputWidth p.fields[i].SetWidth(inputWidth)
} }
} }
@@ -223,7 +223,7 @@ func (p *PresetPicker) CancelForm() {
} }
// Update handles input events for form mode. // Update handles input events for form mode.
func (p *PresetPicker) Update(msg tea.KeyMsg) tea.Cmd { func (p *PresetPicker) Update(msg tea.KeyPressMsg) tea.Cmd {
switch msg.String() { switch msg.String() {
case "tab", "down": case "tab", "down":
p.nextField() p.nextField()
+1 -1
View File
@@ -4,7 +4,7 @@ package tui
import ( import (
"strings" "strings"
"github.com/charmbracelet/lipgloss" "charm.land/lipgloss/v2"
) )
// Colors - matching kportal style, optimized for dark terminals // Colors - matching kportal style, optimized for dark terminals