[PR #203] [CLOSED] Implementing the Table widget. #253

Closed
opened 2026-03-03 16:23:32 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mum4k/termdash/pull/203
Author: @mum4k
Created: 5/4/2019
Status: Closed

Base: develHead: table


📝 Commits (10+)

  • 98cd828 Defining API for the Table widget.
  • 795d92b Cleaning the examples.
  • b11eb11 Merge branch 'devel' into table
  • d47c6cf Adding options for text trimming.
  • ad40f75 Drafting validation for table.
  • 381abee More validation.
  • effca07 Finalizing the option validation.
  • 2fc4ffc Adding licences.
  • e36e1d7 POC code that determines column widths.
  • a5fc072 Memoization for columnWidths.

📊 Changes

23 files changed (+3397 additions, -5 deletions)

View changed files

📝 cell/cell.go (+6 -0)
📝 cell/cell_test.go (+11 -5)
📝 internal/canvas/buffer/buffer.go (+10 -0)
📝 internal/canvas/buffer/buffer_test.go (+32 -0)
📝 internal/numbers/numbers.go (+9 -0)
📝 internal/numbers/numbers_test.go (+40 -0)
widgets/table/content.go (+276 -0)
widgets/table/content_cell.go (+220 -0)
widgets/table/content_cell_test.go (+84 -0)
widgets/table/content_data.go (+103 -0)
widgets/table/content_row.go (+227 -0)
widgets/table/content_test.go (+359 -0)
widgets/table/content_validate.go (+84 -0)
widgets/table/hierarchical.go (+134 -0)
widgets/table/hierarchical_test.go (+340 -0)
widgets/table/layout.go (+77 -0)
widgets/table/layout_test.go (+83 -0)
widgets/table/layout_widths.go (+278 -0)
widgets/table/layout_widths_test.go (+595 -0)
widgets/table/options.go (+126 -0)

...and 3 more files

📄 Description

Fixes #5.

Steps:

  • Define the API.
  • Calculate column widths dynamically according to content.
  • Account for padding in algorithm that calculates column widths.
  • Given cvsWidth, calculate width available to cells (minus border and padding).
  • Each row should report its required height (cell content + padding).
  • Draw row by row, bottom up or top-down (direction of scroll). Support partially drawn rows.
  • Function that returns an area available for a cell.
  • Function on each cell that draws its content (best effort on size at this point).
  • Ensure content copies data given by the user to prevent races.
  • Support sorting by columns.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mum4k/termdash/pull/203 **Author:** [@mum4k](https://github.com/mum4k) **Created:** 5/4/2019 **Status:** ❌ Closed **Base:** `devel` ← **Head:** `table` --- ### 📝 Commits (10+) - [`98cd828`](https://github.com/mum4k/termdash/commit/98cd828606e1a0dd0eb28fb0f68a3974d33a18db) Defining API for the Table widget. - [`795d92b`](https://github.com/mum4k/termdash/commit/795d92b69cd96f08640d2a399c054bee49734dd8) Cleaning the examples. - [`b11eb11`](https://github.com/mum4k/termdash/commit/b11eb1137861b53fd3a5302805ca6c8fcb7e067f) Merge branch 'devel' into table - [`d47c6cf`](https://github.com/mum4k/termdash/commit/d47c6cf0ffaf249a09c29a6269396da8a2355541) Adding options for text trimming. - [`ad40f75`](https://github.com/mum4k/termdash/commit/ad40f757f67651c7f3272551db18d97152eee93e) Drafting validation for table. - [`381abee`](https://github.com/mum4k/termdash/commit/381abee9e3f694421a4dc092a0abd7fb4861f9c7) More validation. - [`effca07`](https://github.com/mum4k/termdash/commit/effca07aa740129a16b4b09fe0558a8f305dd57e) Finalizing the option validation. - [`2fc4ffc`](https://github.com/mum4k/termdash/commit/2fc4ffc9e3ea01e79073824f63ae68ce70b92afb) Adding licences. - [`e36e1d7`](https://github.com/mum4k/termdash/commit/e36e1d7ba748274837648a8a01e18916f30951f0) POC code that determines column widths. - [`a5fc072`](https://github.com/mum4k/termdash/commit/a5fc07238e1fb6f5e8a50a9b6031c7791a4efc8c) Memoization for columnWidths. ### 📊 Changes **23 files changed** (+3397 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `cell/cell.go` (+6 -0) 📝 `cell/cell_test.go` (+11 -5) 📝 `internal/canvas/buffer/buffer.go` (+10 -0) 📝 `internal/canvas/buffer/buffer_test.go` (+32 -0) 📝 `internal/numbers/numbers.go` (+9 -0) 📝 `internal/numbers/numbers_test.go` (+40 -0) ➕ `widgets/table/content.go` (+276 -0) ➕ `widgets/table/content_cell.go` (+220 -0) ➕ `widgets/table/content_cell_test.go` (+84 -0) ➕ `widgets/table/content_data.go` (+103 -0) ➕ `widgets/table/content_row.go` (+227 -0) ➕ `widgets/table/content_test.go` (+359 -0) ➕ `widgets/table/content_validate.go` (+84 -0) ➕ `widgets/table/hierarchical.go` (+134 -0) ➕ `widgets/table/hierarchical_test.go` (+340 -0) ➕ `widgets/table/layout.go` (+77 -0) ➕ `widgets/table/layout_test.go` (+83 -0) ➕ `widgets/table/layout_widths.go` (+278 -0) ➕ `widgets/table/layout_widths_test.go` (+595 -0) ➕ `widgets/table/options.go` (+126 -0) _...and 3 more files_ </details> ### 📄 Description Fixes #5. Steps: - [x] Define the API. - [x] Calculate column widths dynamically according to content. - [x] Account for padding in algorithm that calculates column widths. - [x] Given cvsWidth, calculate width available to cells (minus border and padding). - [ ] Each row should report its required height (cell content + padding). - [ ] Draw row by row, bottom up or top-down (direction of scroll). Support partially drawn rows. - [ ] Function that returns an area available for a cell. - [ ] Function on each cell that draws its content (best effort on size at this point). - [ ] Ensure content copies data given by the user to prevent races. - [ ] Support sorting by columns. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 16:23:32 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termdash#253
No description provided.