Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(table): use lipgloss table for rendering #617

Draft
wants to merge 27 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f24890f
wip: runs but broken border
bashbunni Sep 11, 2024
0ce4f92
wip: include tests
bashbunni Sep 11, 2024
63869e3
feat: add BorderHeader to Styles
bashbunni Sep 11, 2024
87b61f8
feat: include NormalBorder in DefaultStyles
bashbunni Sep 11, 2024
1c621af
refactor: tidy; make Options bodies call setters
bashbunni Sep 11, 2024
e18aafc
chore: remove header const from exports
bashbunni Sep 11, 2024
7b5c6cb
chore: tidy
bashbunni Sep 12, 2024
2e34a23
refactor: make SetHeaders variadic
bashbunni Sep 12, 2024
30bed82
fix(table): style selected row
bashbunni Sep 14, 2024
605b8ac
wip: add scrolling
bashbunni Sep 16, 2024
791d89b
wip: general yoffset logic. Needs clean + height fix
bashbunni Sep 20, 2024
ee1ba24
refactor(table): use maxYOffset
bashbunni Sep 20, 2024
c436cff
wip: fix table styles
bashbunni Sep 24, 2024
be32116
fix(test): update outputs for TestTableAlignment
bashbunni Sep 24, 2024
e242987
refactor(test): update error message for TestSetCursor
bashbunni Sep 24, 2024
14927f0
fix(test): set correct type in comparison for TestFromValuesWithTabSe…
bashbunni Sep 25, 2024
a0b7e17
fix(table): use 0 as first row index (no off by one)
bashbunni Sep 25, 2024
f1f0c4c
chore(deps): use use-lipgloss-table branch of lipgloss
bashbunni Sep 25, 2024
cae0428
chore: tidy
bashbunni Sep 25, 2024
b483f6d
feat(table): add SetBorder function to set/unset borders
bashbunni Sep 25, 2024
c9845d8
chore(DONT MERGE): use use-lipgloss-table branch of lipgloss
bashbunni Sep 25, 2024
add073a
chore: tidy TODOs
bashbunni Sep 25, 2024
819e021
wip(docs): proposal outline
bashbunni Sep 25, 2024
e7821ea
feat(table): bring back SetColumn
bashbunni Sep 25, 2024
48eb859
feat(table): Bring back Height and Rows
bashbunni Sep 25, 2024
6548f4e
feat(table): add option for custom StyleFunc
bashbunni Sep 25, 2024
9516572
test(table): failing text alignment
bashbunni Sep 25, 2024
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 go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require (
github.com/atotto/clipboard v0.1.4
github.com/charmbracelet/bubbletea v1.1.0
github.com/charmbracelet/harmonica v0.2.0
github.com/charmbracelet/lipgloss v0.13.0
github.com/charmbracelet/x/ansi v0.2.3
github.com/charmbracelet/lipgloss v0.13.1-0.20240924011622-17b470d8991e
github.com/charmbracelet/x/ansi v0.3.2
github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b
github.com/dustin/go-humanize v1.0.1
github.com/lucasb-eyer/go-colorful v1.2.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ github.com/charmbracelet/bubbletea v1.1.0 h1:FjAl9eAL3HBCHenhz/ZPjkKdScmaS5SK69J
github.com/charmbracelet/bubbletea v1.1.0/go.mod h1:9Ogk0HrdbHolIKHdjfFpyXJmiCzGwy+FesYkZr7hYU4=
github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ=
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
github.com/charmbracelet/lipgloss v0.13.0 h1:4X3PPeoWEDCMvzDvGmTajSyYPcZM4+y8sCA/SsA3cjw=
github.com/charmbracelet/lipgloss v0.13.0/go.mod h1:nw4zy0SBX/F/eAO1cWdcvy6qnkDUxr8Lw7dvFrAIbbY=
github.com/charmbracelet/x/ansi v0.2.3 h1:VfFN0NUpcjBRd4DnKfRaIRo53KRgey/nhOoEqosGDEY=
github.com/charmbracelet/x/ansi v0.2.3/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=
github.com/charmbracelet/lipgloss v0.13.1-0.20240924011622-17b470d8991e h1:sc5K4dGwO7gpZsNNigIaDOgpMoe2JLuHXekLGD9EdwA=
github.com/charmbracelet/lipgloss v0.13.1-0.20240924011622-17b470d8991e/go.mod h1:zaYVJ2xKSKEnTEEbX6uAHabh2d975RJ+0yfkFpRBz5U=
github.com/charmbracelet/x/ansi v0.3.2 h1:wsEwgAN+C9U06l9dCVMX0/L3x7ptvY1qmjMwyfE6USY=
github.com/charmbracelet/x/ansi v0.3.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=
github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b h1:MnAMdlwSltxJyULnrYbkZpp4k58Co7Tah3ciKhSNo0Q=
github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0=
Expand Down
16 changes: 16 additions & 0 deletions proposal.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#+title: v2 Proposal

* Table
** API Changes
The API will change to streamline the experience of working with tables across
the Bubbles and Lip Gloss libraries.
*** Change
- ~type Column, Row~ -> ~[]string~ for better reusability
- ~func (m Model) Columns() []Column~ -> ~func (m Model) Headers(headers []string)~
- Columns -> Headers
- Header calculations are delegated to Lip Gloss
**** Modifiers
- ~func (m *Model) SetRows(r []Row)~ -> ~func (m *Model) Rows(rows ...[]string)~
- ~func (m *Model) SetStyles(s Styles)~ -> ~func (m *Model) Styles(s Styles)~
- ~func (m *Model) Width(w int)~ -> ~func (m *Model) Width(w int)~
- ~func (m Model) Height() int~ -> ~func (m *Model) Height(h int) *Model~
Loading
Loading