59 Commits
Author SHA1 Message Date
Andrey Nering 04ec518a95 chore: run modernize 2025-05-30 17:20:01 -03:00
Carlos Alexandro Becker 9d2d5dfc71 Merge remote-tracking branch 'origin/master' into v2-exp 2025-03-31 14:20:56 -03:00
Carlos Alexandro BeckerandGitHub bd2a5b0c6a fix: golangci-lint 2 fixes (#769) 2025-03-31 14:18:18 -03:00
Andrey Nering fff86382cc chore(lint): remove custom min and max functions
These are now available as builtins.
2025-03-20 10:42:52 -03:00
Carlos Alexandro BeckerandGitHub 64c16e990e feat(v2)!: update to go 1.22 (#724)
* feat(v2)!: update to go 1.22

* fix: ci

* fix: more
2025-02-05 10:00:01 -03:00
Ayman Bagabas 061e464a70 refactor!: restore bubbletea model interface 2025-02-04 13:01:13 -05:00
Ayman BagabasandGitHub a0d9fe396d refactor: progress: return Model instead of tea.Model (#719)
This conforms to the new generic bubbletea API.
See https://github.com/charmbracelet/bubbletea/pull/1298
2025-01-29 15:59:11 -05:00
2e3a42396e chore(progress)!: migrate progress to lipgloss (#676)
* chore(progress)!: migrate progress to lipgloss

This removes the dependency on termenv and replaces it with lipgloss. This
change also removes the WithColorProfile option, as it is no longer needed.
The new API uses `color.Color` types for colors, which are more flexible and
allow for more advanced color manipulation.

* Update progress/progress_test.go

Co-authored-by: Christian Rocha <christian@rocha.is>

* Update progress/progress_test.go

Co-authored-by: Christian Rocha <christian@rocha.is>

* chore: go mod tidy

---------

Co-authored-by: Christian Rocha <christian@rocha.is>
2024-12-12 10:51:23 -05:00
Christian Rocha 4b0f9c8282 feat!(progress): width now uses getters and setters 2024-10-31 15:02:05 -04:00
Ayman Bagabas db64e3cd78 feat: update lipgloss to v2 2024-10-29 15:54:24 -04:00
Christian Rocha 57ac102802 chore(merge): branch 'master' into v2-mini-tidy 2024-10-24 15:22:16 -04:00
Christian Rocha 358a6c58c8 chore(lint): fix and suppress all soft lint issues; update directives 2024-10-24 12:35:42 -04:00
Ayman Bagabas 287c9c4ffd chore: merge branch 'master' into v2-exp 2024-10-21 14:16:22 -04:00
9a262e9b0f fix: use atomic for ids (#634)
closes #622

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Ville Valkonen <weezel@users.noreply.github.com>
2024-10-07 15:26:12 -03:00
Ayman Bagabas 09242fdf67 refactor!: remove deprecated references
This removes all the `NewModel` functions from all the bubbles and any
deprecated fields and types.
2024-09-19 13:44:03 -04:00
Ayman Bagabas 0fdf5f5be5 feat: use bubbletea/v2 2024-09-18 14:09:58 -04:00
Ayman Bagabas a93bfef532 feat!: use bubbletea@v2-exp 2024-09-09 14:12:52 -04:00
Florian ReyandChristian Rocha c3e07c9b36 fix: progress default spring option 2024-06-17 09:03:35 -04:00
Ayman BagabasandGitHub e1ea5dc528 refactor: switch to x/ansi for text manipulation (#505)
Need to be consistent with Lipgloss and https://github.com/charmbracelet/lipgloss/pull/279
2024-05-23 15:13:44 -04:00
Carlos Alexandro Becker 50b0bb0f3b docs: fix typo
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2024-05-14 22:21:14 -03:00
Randall WinkhartandChristian Rocha 350d5e99d9 Rename WithCustomFillCharacters to WithFillCharacters 2024-02-06 09:06:12 -05:00
Randall WinkhartandChristian Rocha 7fe39190c8 feat(progress): make full/empty fill characters configurable 2024-02-06 09:06:12 -05:00
Yurii RashkovskiiandChristian Rocha fe31dc0a97 Problem: can't determine if the progress bar stopped updating
This would be useful to know to stop displaying it after the user was shown
the progress bar to render to its end.

Solution: expose `IsComplete` method is based on what's been drawn
2023-06-13 12:48:00 -04:00
Ben DimbeckandGitHub 876d5af152 fix(progress): last gradient color off by one (#338)
* fix(progress): add failing test

The progress bar component does not render the gradient 100% correctly:
The very last color that appears in the rendered progress bar should be
the second color defined in the gradient but it is not, due to an
off-by-one one error.

This test case shows this. The next commit will contain the fix.

* fix(progress): use the second gradient color as the last char of the bar

Due to an off-by-one error, the very last rendered color+char was never
exactly the second specified gradient color. The fixed code looks less
elegant unfortunately, but now the last color is the desired one.
2023-03-24 10:32:43 -07:00
Glenn GondaandChristian Rocha 3d3ed883d3 docs: fix typos and improve comment clarity 2023-02-16 17:49:32 -05:00
Christian Rocha 30c01cabdc chore: apply appropriate GoDoc syntax to deprecated items 2022-11-17 10:41:13 -05:00
Tom PayneandGitHub 72d87e4513 chore: Miscellaneous minor fixes (#243)
* chore: remove internal use of deprecated NewModel

* chore: miscellaneous comment fixes
2022-09-15 10:51:42 -04:00
Ayman BagabasandGitHub 7959eb4867 fix(progress): set a custom termenv color profile (#152) 2022-06-01 18:04:33 -07:00
Christian Rocha d897463138 chore(progress): Percent() now return progress as presented visually
Prior to this change Percent() returned the target progress to which the
progress bar was animating.
2022-03-30 14:48:46 -04:00
Christian Rocha 091c915462 Fix various godoc comments 2022-01-19 12:31:50 -05:00
Christian Rocha b35f96cd2d Deprecate NewModel() constructors; use New() instead 2022-01-11 11:26:13 -05:00
Christian Rocha b691d7f07e Progress bars now statisfy the tea.Model interface 2021-09-07 13:57:46 -04:00
Christian Muehlhaeuser cb52746b97 Fix typos 2021-08-23 23:15:21 +02:00
Christian Rocha e723cfd15e Add WithSpringOptions to customize spring in NewModel 2021-07-26 12:41:37 -04:00
Christian Rocha 90d8eaffeb Update progress bar with public harmonica release 2021-07-26 12:41:37 -04:00
Christian Rocha 202d5a9f9d Progress's NewModel no longer returns an error for better usability
To that end, bad hex colors also default to black. This is also how we
handle bad hex notation in Lip Gloss.
2021-07-26 12:41:37 -04:00
Christian Rocha 446433d680 Use Lip Gloss to style percentage in progress bubble 2021-07-26 12:41:37 -04:00
Christian Rocha 2cd3b16343 Use Harmonica to animate progress bar 2021-07-26 12:41:37 -04:00
Christian Rocha 20ead8fb7d Progress can now animate itself 2021-07-26 12:41:37 -04:00
Christian Muehlhaeuser da9a4049de Mark innocuous numbers as nolint 2021-03-12 01:47:40 +01:00
Christian Rocha 43d43d14ae A external link to progress example and remove local example 2021-01-12 18:17:42 -05:00
Christian RochaandChristian Rocha f9c79eef64 Slightly more subtle default gradient 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha c303de1e85 Replace "ramp" with "gradient" on exposed functions 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 7e5ef42924 Add ability to style percentage readout 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 79ca4d09d1 Fix doc comments and remove magic number 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha f48e53556a Return an error if we could not initialize a new gradient ramp 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 5d6d8cb0fb Add functional argument for setting the width of the progress bar 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 47b8d9c6a8 Doc comments, optimizations, and magic number removal 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha b78277e7ec Add progress bar example 2020-12-01 17:03:48 -05:00
Christian RochaandChristian Rocha 6a768905a6 Add initialization options for scaled ramps 2020-12-01 17:03:48 -05:00