Skip to content

Commit 421843b

Browse files
committed
chore(merge): branch 'master' into v2-exp
2 parents 518ff7d + 1bdd4c6 commit 421843b

File tree

3 files changed

+32
-70
lines changed

3 files changed

+32
-70
lines changed

README.md

+30-68
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Bubbles
2-
=======
1+
# Bubbles
32

43
<p>
54
<img src="https://stuff.charm.sh/bubbles/bubbles-github.png" width="233" alt="The Bubbles Logo">
@@ -18,17 +17,15 @@ applications. These components are used in production in [Glow][glow],
1817
[charm]: https://github.com/charmbracelet/charm
1918
[otherstuff]: https://github.com/charmbracelet/bubbletea/#bubble-tea-in-the-wild
2019

21-
2220
## Spinner
2321

2422
<img src="https://stuff.charm.sh/bubbles-examples/spinner.gif" width="400" alt="Spinner Example">
2523

2624
A spinner, useful for indicating that some kind an operation is happening.
2725
There are a couple default ones, but you can also pass your own ”frames.”
2826

29-
* [Example code, basic spinner](https://github.com/charmbracelet/bubbletea/tree/master/examples/spinner/main.go)
30-
* [Example code, various spinners](https://github.com/charmbracelet/bubbletea/tree/master/examples/spinners/main.go)
31-
27+
- [Example code, basic spinner](https://github.com/charmbracelet/bubbletea/tree/master/examples/spinner/main.go)
28+
- [Example code, various spinners](https://github.com/charmbracelet/bubbletea/tree/master/examples/spinners/main.go)
3229

3330
## Text Input
3431

@@ -38,20 +35,20 @@ A text input field, akin to an `<input type="text">` in HTML. Supports unicode,
3835
pasting, in-place scrolling when the value exceeds the width of the element and
3936
the common, and many customization options.
4037

41-
* [Example code, one field](https://github.com/charmbracelet/bubbletea/tree/master/examples/textinput/main.go)
42-
* [Example code, many fields](https://github.com/charmbracelet/bubbletea/tree/master/examples/textinputs/main.go)
38+
- [Example code, one field](https://github.com/charmbracelet/bubbletea/tree/master/examples/textinput/main.go)
39+
- [Example code, many fields](https://github.com/charmbracelet/bubbletea/tree/master/examples/textinputs/main.go)
4340

4441
## Text Area
4542

4643
<img src="https://stuff.charm.sh/bubbles-examples/textarea.gif" width="400" alt="Text Area Example">
4744

4845
A text area field, akin to an `<textarea />` in HTML. Allows for input that
4946
spans multiple lines. Supports unicode, pasting, vertical scrolling when the
50-
value exceeds the width and height of the element, and many customization
47+
value exceeds the width and height of the element, and many customization
5148
options.
5249

53-
* [Example code, chat input](https://github.com/charmbracelet/bubbletea/tree/master/examples/chat/main.go)
54-
* [Example code, story time input](https://github.com/charmbracelet/bubbletea/tree/master/examples/textarea/main.go)
50+
- [Example code, chat input](https://github.com/charmbracelet/bubbletea/tree/master/examples/chat/main.go)
51+
- [Example code, story time input](https://github.com/charmbracelet/bubbletea/tree/master/examples/textarea/main.go)
5552

5653
## Table
5754

@@ -60,7 +57,7 @@ options.
6057
A component for displaying and navigating tabular data (columns and rows).
6158
Supports vertical scrolling and many customization options.
6259

63-
* [Example code, countries and populations](https://github.com/charmbracelet/bubbletea/tree/master/examples/table/main.go)
60+
- [Example code, countries and populations](https://github.com/charmbracelet/bubbletea/tree/master/examples/table/main.go)
6461

6562
## Progress
6663

@@ -71,12 +68,11 @@ A simple, customizable progress meter, with optional animation via
7168
runes can be set to whatever you'd like. The percentage readout is customizable
7269
and can also be omitted entirely.
7370

74-
* [Animated example](https://github.com/charmbracelet/bubbletea/blob/master/examples/progress-animated/main.go)
75-
* [Static example](https://github.com/charmbracelet/bubbletea/blob/master/examples/progress-static/main.go)
71+
- [Animated example](https://github.com/charmbracelet/bubbletea/blob/master/examples/progress-animated/main.go)
72+
- [Static example](https://github.com/charmbracelet/bubbletea/blob/master/examples/progress-static/main.go)
7673

7774
[harmonica]: https://github.com/charmbracelet/harmonica
7875

79-
8076
## Paginator
8177

8278
<img src="https://stuff.charm.sh/bubbles-examples/pagination.gif" width="200" alt="Paginator Example">
@@ -86,8 +82,7 @@ Supports "dot-style" pagination (similar to what you might see on iOS) and
8682
numeric page numbering, but you could also just use this component for the
8783
logic and visualize pagination however you like.
8884

89-
* [Example code](https://github.com/charmbracelet/bubbletea/blob/master/examples/paginator/main.go)
90-
85+
- [Example code](https://github.com/charmbracelet/bubbletea/blob/master/examples/paginator/main.go)
9186

9287
## Viewport
9388

@@ -97,14 +92,13 @@ A viewport for vertically scrolling content. Optionally includes standard
9792
pager keybindings and mouse wheel support. A high performance mode is available
9893
for applications which make use of the alternate screen buffer.
9994

100-
* [Example code](https://github.com/charmbracelet/bubbletea/tree/master/examples/pager/main.go)
95+
- [Example code](https://github.com/charmbracelet/bubbletea/tree/master/examples/pager/main.go)
10196

10297
This component is well complemented with [Reflow][reflow] for ANSI-aware
10398
indenting and text wrapping.
10499

105100
[reflow]: https://github.com/muesli/reflow
106101

107-
108102
## List
109103

110104
<img src="https://stuff.charm.sh/bubbles-examples/list.gif" width="600" alt="List Example">
@@ -114,9 +108,9 @@ Features pagination, fuzzy filtering, auto-generated help, an activity spinner,
114108
and status messages, all of which can be enabled and disabled as needed.
115109
Extrapolated from [Glow][glow].
116110

117-
* [Example code, default list](https://github.com/charmbracelet/bubbletea/tree/master/examples/list-default/main.go)
118-
* [Example code, simple list](https://github.com/charmbracelet/bubbletea/tree/master/examples/list-simple/main.go)
119-
* [Example code, all features](https://github.com/charmbracelet/bubbletea/tree/master/examples/list-fancy/main.go)
111+
- [Example code, default list](https://github.com/charmbracelet/bubbletea/tree/master/examples/list-default/main.go)
112+
- [Example code, simple list](https://github.com/charmbracelet/bubbletea/tree/master/examples/list-simple/main.go)
113+
- [Example code, all features](https://github.com/charmbracelet/bubbletea/tree/master/examples/list-fancy/main.go)
120114

121115
## File Picker
122116

@@ -126,7 +120,7 @@ A customizable component for picking a file from the file system. Navigate
126120
through directories and select files, optionally limit to certain file
127121
extensions.
128122

129-
* [Example code](https://github.com/charmbracelet/bubbletea/tree/master/examples/file-picker/main.go)
123+
- [Example code](https://github.com/charmbracelet/bubbletea/tree/master/examples/file-picker/main.go)
130124

131125
## Timer
132126

@@ -135,8 +129,7 @@ can be customized as you like.
135129

136130
<img src="https://stuff.charm.sh/bubbles-examples/timer.gif" width="400" alt="Timer example">
137131

138-
* [Example code](https://github.com/charmbracelet/bubbletea/blob/master/examples/timer/main.go)
139-
132+
- [Example code](https://github.com/charmbracelet/bubbletea/blob/master/examples/timer/main.go)
140133

141134
## Stopwatch
142135

@@ -145,8 +138,7 @@ can be customized as you like.
145138
A simple, flexible component for counting up. The update frequency and output
146139
can be customized as you see fit.
147140

148-
* [Example code](https://github.com/charmbracelet/bubbletea/blob/master/examples/stopwatch/main.go)
149-
141+
- [Example code](https://github.com/charmbracelet/bubbletea/blob/master/examples/stopwatch/main.go)
150142

151143
## Help
152144

@@ -157,8 +149,7 @@ from your keybindings. It features single and multi-line modes, which the user
157149
can optionally toggle between. It will truncate gracefully if the terminal is
158150
too wide for the content.
159151

160-
* [Example code](https://github.com/charmbracelet/bubbletea/blob/master/examples/help/main.go)
161-
152+
- [Example code](https://github.com/charmbracelet/bubbletea/blob/master/examples/help/main.go)
162153

163154
## Key
164155

@@ -197,42 +188,13 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
197188
}
198189
```
199190

191+
## There’s more where that came from
200192

201-
## Additional Bubbles
202-
203-
<!-- in alphabetical order by author -->
204-
205-
* [76creates/stickers](https://github.com/76creates/stickers): Responsive
206-
flexbox and table components.
207-
* [calyptia/go-bubble-table](https://github.com/calyptia/go-bubble-table): An
208-
interactive, customizable, scrollable table component.
209-
* [erikgeiser/promptkit](https://github.com/erikgeiser/promptkit): A collection
210-
of common prompts for cases like selection, text input, and confirmation.
211-
Each prompt comes with sensible defaults, remappable keybindings, any many
212-
customization options.
213-
* [evertras/bubble-table](https://github.com/Evertras/bubble-table): Interactive,
214-
customizable, paginated tables.
215-
* [knipferrc/teacup](https://github.com/knipferrc/teacup): Various handy
216-
bubbles and utilities for building Bubble Tea applications.
217-
* [mritd/bubbles](https://github.com/mritd/bubbles): Some general-purpose
218-
bubbles. Inputs with validation, menu selection, a modified progressbar, and
219-
so on.
220-
* [kevm/bubbleo](https://github.com/KevM/bubbleo): A set of bubbles with a
221-
focus on navigation: navigation stacks, breakcrumbs, menus and so on.
222-
* [treilik/bubbleboxer](https://github.com/treilik/bubbleboxer): Layout
223-
multiple bubbles side-by-side in a layout-tree.
224-
* [treilik/bubblelister](https://github.com/treilik/bubblelister): An alternate
225-
list that is scrollable without pagination and has the ability to contain
226-
other bubbles as list items.
227-
228-
If you’ve built a Bubble you think should be listed here, please create a Pull
229-
Request. Please note that for a project to be included, it must meet the
230-
following requirements:
231-
- The README has a demo GIF.
232-
- The README clearly states the purpose of the bubble along with an example on how to use it.
233-
- The bubble must *always* be in a working state on its `main` branch.
234-
235-
Thank you!
193+
To check out community-maintained Bubbles see [Charm &
194+
Friends](https://github.com/charm-and-friends/additional-bubbles). Made a cool Bubble
195+
that you want to share?
196+
[PRs](https://github.com/charm-and-friends/additional-bubbles?tab=readme-ov-file#what-is-a-complete-project)
197+
are welcome!
236198

237199
## Contributing
238200

@@ -244,15 +206,15 @@ See [contributing][contribute].
244206

245207
We’d love to hear your thoughts on this project. Feel free to drop us a note!
246208

247-
* [Twitter](https://twitter.com/charmcli)
248-
* [The Fediverse](https://mastodon.social/@charmcli)
249-
* [Discord](https://charm.sh/chat)
209+
- [Twitter](https://twitter.com/charmcli)
210+
- [The Fediverse](https://mastodon.social/@charmcli)
211+
- [Discord](https://charm.sh/chat)
250212

251213
## License
252214

253215
[MIT](https://github.com/charmbracelet/bubbletea/raw/master/LICENSE)
254216

255-
***
217+
---
256218

257219
Part of [Charm](https://charm.sh).
258220

stopwatch/stopwatch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (m Model) Init() (Model, tea.Cmd) {
8686

8787
// Start starts the stopwatch.
8888
func (m Model) Start() tea.Cmd {
89-
return tea.Batch(func() tea.Msg {
89+
return tea.Sequence(func() tea.Msg {
9090
return StartStopMsg{ID: m.id, running: true}
9191
}, tick(m.id, m.tag, m.Interval))
9292
}

viewport/viewport.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func (m *Model) SetContent(s string) {
171171
// maxYOffset returns the maximum possible value of the y-offset based on the
172172
// viewport's content and set height.
173173
func (m Model) maxYOffset() int {
174-
return max(0, len(m.lines)-m.Height())
174+
return max(0, len(m.lines)-m.Height()+m.Style.GetVerticalFrameSize())
175175
}
176176

177177
// visibleLines returns the lines that should currently be visible in the

0 commit comments

Comments
 (0)