Skip to content

Commit

Permalink
Remove row ID special casing
Browse files Browse the repository at this point in the history
The upcoming enumerate operator will allow users to decide explicitly
whether the row ID should be part of the data.
  • Loading branch information
mavam committed May 22, 2023
1 parent 258be65 commit dfe2d0b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
3 changes: 0 additions & 3 deletions plugins/tui/include/tui/ui_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ namespace vast::plugins::tui {
struct ui_state {
/// The state for a table.
struct table_state {
/// An extra column with row IDs.
ftxui::Component rids;

/// The leaf columns.
std::vector<ftxui::Component> leaves;

Expand Down
5 changes: 0 additions & 5 deletions plugins/tui/src/components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,6 @@ auto Explorer(ui_state* state) -> Component {
} else {
VAST_ASSERT(state_->tables.contains(schema));
auto& table_state = state_->tables[schema];
// Prepend rids.
if (index == 0) {
result->Add(table_state.rids);
result->Add(component(state_->theme.separator()));
}
// Fetch leaf column from UI state.
VAST_ASSERT(index < table_state.leaves.size());
auto column = table_state.leaves[index++];
Expand Down
12 changes: 0 additions & 12 deletions plugins/tui/src/ui_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,6 @@ auto ui_state::add(table_slice slice) -> void {
state.leaves.push_back(column);
}
VAST_ASSERT(state.leaves.size() == schema.num_leaves());
// TODO: we want to get rid of this special casing of RIDs. Ideally, the user
// provides a dedicated 'enumerate' operator that adds the RIDs at the data
// level. Or this operator gets a flag to opt of that. But the special casing
// needs to go regardless.
state.rids = Container::Vertical({});
auto height = detail::narrow_cast<int>(schema.depth() * 2);
auto header = Header(" # ", "", height, theme);
state.rids->Add(header);
state.rids->Add(component(theme.separator()));
auto base = uint64_t{state.rids->ChildCount() - 2};
for (size_t j = 0; j < slice.rows(); ++j)
state.rids->Add(Cell(view<data>{base + j}, theme));
}

} // namespace vast::plugins::tui

0 comments on commit dfe2d0b

Please sign in to comment.