Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
03e7ef4
feat(linux-grid): add row numbers, row height and NULL text preferences
sedax90 Nov 8, 2026
390a0a3
feat(linux-grid): let the data grid have its own cell font
sedax90 Nov 8, 2026
8c415d7
feat(linux-grid): choose the format Copy writes for several rows
sedax90 Nov 8, 2026
2bc031b
feat(linux-grid): open row details when a row is selected, if asked
sedax90 Nov 8, 2026
6ed90a9
feat(linux-grid): sort a table by a default column when it opens
sedax90 Nov 8, 2026
ff5eae3
fix(linux-grid): show the chosen NULL text in editable cells too
sedax90 Nov 8, 2026
e13f6f5
Merge branch 'feat/linux-grid-display-settings' into feat/linux-grid-…
sedax90 Nov 8, 2026
4db6483
Merge branch 'feat/linux-grid-font' into feat/linux-row-copy-format
sedax90 Nov 8, 2026
d31a4f6
Merge branch 'feat/linux-row-copy-format' into feat/linux-auto-inspector
sedax90 Nov 8, 2026
371e4b2
Merge branch 'feat/linux-auto-inspector' into feat/linux-default-sort
sedax90 Nov 8, 2026
ab70c2d
fix(linux-grid): share live display preferences across grids
datlechin Nov 8, 2026
1d3f362
fix(linux-grid): merge updated NULL display behavior
datlechin Nov 8, 2026
b0f30c2
feat(linux-grid): scope cell fonts to each grid
datlechin Nov 8, 2026
76e860b
Merge branch 'feat/linux-grid-font' of https://github.com/sedax90/Tab…
datlechin Nov 8, 2026
1ad8564
fix(linux-grid): synchronize row copy format preferences
datlechin Nov 8, 2026
e1d1f5b
fix(linux-grid): open row details only for selected rows
datlechin Nov 8, 2026
3a92ff3
fix(linux-grid): preserve saved sort choices with shared defaults
datlechin Nov 8, 2026
c0da2cf
fix(linux-grid): keep display preferences when resetting columns
datlechin Nov 8, 2026
c03b4eb
test(linux-grid): load native styles for row height checks
datlechin Nov 8, 2026
45b2c6f
fix(linux-grid): merge display reset and test fixture fixes
datlechin Nov 8, 2026
a19f02a
fix(linux-grid): merge display reset and test fixture fixes
datlechin Nov 8, 2026
c791e77
fix(linux-grid): merge display reset and test fixture fixes
datlechin Nov 8, 2026
9a2ddbd
fix(linux-grid): merge display reset and test fixture fixes
datlechin Nov 8, 2026
38801c1
fix(linux-grid): expose editor state within row details
datlechin Nov 8, 2026
bbbaaac
fix(linux-grid): merge row detail test visibility fix
datlechin Nov 8, 2026
f0b3070
test(linux-grid): isolate settings notification contexts
datlechin Nov 8, 2026
36f6505
test(linux-grid): merge isolated settings contexts
datlechin Nov 8, 2026
d702bda
test(linux-grid): merge isolated settings contexts
datlechin Nov 8, 2026
d671bf3
test(linux-grid): merge isolated settings contexts
datlechin Nov 8, 2026
0cd3691
test(linux-grid): merge isolated settings contexts
datlechin Nov 8, 2026
65b6a7f
fix(linux-grid): type the settings test shutdown channel
datlechin Nov 8, 2026
1f2ca73
fix(linux-grid): merge the settings test channel type
datlechin Nov 8, 2026
4b52c85
fix(linux-grid): merge the settings test channel type
datlechin Nov 8, 2026
83a7fd8
fix(linux-grid): merge the settings test channel type
datlechin Nov 8, 2026
80692f9
fix(linux-grid): merge the settings test channel type
datlechin Nov 8, 2026
068db68
test(linux-grid): assert copied JSON without unordered maps
datlechin Nov 8, 2026
6c94494
test(linux-grid): merge the ordered JSON assertions
datlechin Nov 8, 2026
28a8390
test(linux-grid): merge the ordered JSON assertions
datlechin Nov 8, 2026
1d48659
Merge branch 'main' into feat/linux-grid-font
datlechin Nov 9, 2026
41df39f
fix(linux-grid): pass the NULL text to the row details search
datlechin Nov 9, 2026
1579040
Merge commit '41df39fb6' into feat/linux-default-sort
datlechin Nov 9, 2026
a1d4b07
Merge remote-tracking branch 'origin/main' into feat/linux-default-sort
datlechin Nov 9, 2026
8425752
Merge remote-tracking branch 'origin/main' into feat/linux-grid-font
datlechin Nov 9, 2026
8973772
Merge branch 'feat/linux-grid-font' into feat/linux-row-copy-format
datlechin Nov 9, 2026
ad05a62
Merge branch 'feat/linux-row-copy-format' into feat/linux-auto-inspector
datlechin Nov 9, 2026
ee70f82
Merge commit 'ad05a62e8' into feat/linux-default-sort
datlechin Nov 9, 2026
48409b1
test(linux-grid): box the browse command the default sort test sends
datlechin Nov 9, 2026
329b5e1
Merge remote-tracking branch 'origin/main' into feat/linux-default-sort
datlechin Nov 9, 2026
5a0e6d9
Merge branch 'main' into feat/linux-row-copy-format
datlechin Nov 9, 2026
cac6093
Merge commit '5a0e6d95a' into feat/linux-auto-inspector
datlechin Nov 9, 2026
579e9a6
Merge commit 'cac6093da' into feat/linux-default-sort
datlechin Nov 9, 2026
fb2017d
Merge remote-tracking branch 'origin/main' into feat/linux-row-copy-f…
datlechin Nov 10, 2026
eef6e33
Merge commit 'fb2017ddaf829ac51ca52574b481d2776eb4a684' into feat/lin…
datlechin Nov 10, 2026
af234e8
Merge commit 'eef6e3301fe5418e28c47b55dc281046069cb19e' into feat/lin…
datlechin Nov 10, 2026
b2a4b9c
Merge remote-tracking branch 'origin/main' into feat/linux-row-copy-f…
datlechin Nov 10, 2026
b9ff0f1
Merge commit 'b2a4b9c8fdef800402ee413bfadb55cfbc052832' into feat/lin…
datlechin Nov 10, 2026
6f68027
Merge commit 'b9ff0f1ff3490037750fe0dd97103ad7570aedc5' into feat/lin…
datlechin Nov 10, 2026
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
1 change: 1 addition & 0 deletions linux/changelog.d/4137.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Preferences can set the format Copy writes when several rows are selected, as TSV, JSON, CSV or Markdown.
1 change: 1 addition & 0 deletions linux/changelog.d/4138.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Preferences can open the row details pane whenever a row is selected.
1 change: 1 addition & 0 deletions linux/changelog.d/4140.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Preferences can sort a table by its primary key or first column when it opens, ascending or descending.
14 changes: 11 additions & 3 deletions linux/crates/app/src/ui/browse_tab/data_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ impl BrowseModel {
}

pub(super) fn on_columns_loaded(&mut self, columns: Vec<ColumnInfo>, fx: &mut Effects) {
if let Some((behavior, direction)) = self.default_sort.take() {
let result: Vec<ResultColumn> = columns.iter().map(ColumnInfo::result_column).collect();
let sortable = self.grid_columns_for_catalog(&result, &columns);
self.current_sort =
super::default_sort::resolve(behavior, direction, &sortable).filter(|_| self.sorts_rows());
}
if self.current_columns != columns {
self.page = None;
self.shown_view = None;
Expand Down Expand Up @@ -250,13 +256,15 @@ impl BrowseModel {
/// its place. A document's field whose name a filter, a sort or an
/// update cannot spell takes none of them (ADR 0026).
fn grid_columns_for(&self, result: &[ResultColumn]) -> Arc<[GridColumn]> {
self.grid_columns_for_catalog(result, &self.current_columns)
}

fn grid_columns_for_catalog(&self, result: &[ResultColumn], catalog: &[ColumnInfo]) -> Arc<[GridColumn]> {
let documents = self
.dialect
.as_ref()
.is_some_and(|dialect| dialect.grammar() == SqlGrammar::Mongo);
grid_columns(result, &self.current_columns, |name| {
!documents || is_addressable_field(name)
})
grid_columns(result, catalog, |name| !documents || is_addressable_field(name))
}

/// Give the grid `columns` when it shows others. Its rows go with the
Expand Down
104 changes: 104 additions & 0 deletions linux/crates/app/src/ui/browse_tab/default_sort.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
use tablepro_linux_platform::settings::{DefaultSort, GridSortDirection};

use crate::services::grid::GridColumn;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum InitialSort {
Default,
Kept(Option<(usize, bool)>),
}

pub(super) fn resolve(
behavior: DefaultSort,
direction: GridSortDirection,
columns: &[GridColumn],
) -> Option<(usize, bool)> {
let column = match behavior {
DefaultSort::PrimaryKey => columns
.iter()
.find(|column| column.catalog.as_ref().is_some_and(|catalog| catalog.primary_key))?,
DefaultSort::FirstColumn => columns.first()?,
DefaultSort::None => return None,
};
column.sortable().then_some((column.index, direction.ascending()))
}

#[cfg(test)]
mod tests {
use tablepro_core::ColumnInfo;

use super::*;
use crate::services::grid::grid_columns;
use crate::ui::data_grid::test_grid::named;

fn columns() -> std::sync::Arc<[GridColumn]> {
let catalog = vec![named("name", "text", false), named("id", "integer", true)];
grid_columns(
&catalog.iter().map(ColumnInfo::result_column).collect::<Vec<_>>(),
&catalog,
|_| true,
)
}

#[test]
fn none_sorts_nothing() {
assert_eq!(
resolve(DefaultSort::None, GridSortDirection::Ascending, &columns()),
None
);
}

#[test]
fn primary_key_picks_the_key_column_in_the_direction() {
assert_eq!(
resolve(DefaultSort::PrimaryKey, GridSortDirection::Ascending, &columns()),
Some((1, true))
);
assert_eq!(
resolve(DefaultSort::PrimaryKey, GridSortDirection::Descending, &columns()),
Some((1, false))
);
}

#[test]
fn a_table_without_a_key_stays_unsorted_by_primary_key() {
let keyless = columns()[..1].to_vec();
assert_eq!(
resolve(DefaultSort::PrimaryKey, GridSortDirection::Ascending, &keyless),
None
);
assert_eq!(
resolve(DefaultSort::FirstColumn, GridSortDirection::Ascending, &keyless),
Some((0, true))
);
}

#[test]
fn unaddressable_and_missing_columns_are_not_sorted() {
let mut columns = columns().to_vec();
columns[0].addressable = false;
columns[1].addressable = false;
assert_eq!(
resolve(DefaultSort::FirstColumn, GridSortDirection::Ascending, &columns),
None
);
assert_eq!(
resolve(DefaultSort::PrimaryKey, GridSortDirection::Ascending, &columns),
None
);
assert_eq!(
resolve(DefaultSort::FirstColumn, GridSortDirection::Ascending, &[]),
None
);
}

#[test]
fn a_composite_key_uses_its_first_column() {
let mut columns = columns().to_vec();
columns[0].catalog.as_mut().expect("catalog").primary_key = true;
assert_eq!(
resolve(DefaultSort::PrimaryKey, GridSortDirection::Descending, &columns),
Some((0, false))
);
}
}
18 changes: 16 additions & 2 deletions linux/crates/app/src/ui/browse_tab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mod count_failure_text;
mod count_policy;
mod data_handlers;
mod data_input;
mod default_sort;
mod fetch;
mod grid_handlers;
mod grid_input;
Expand Down Expand Up @@ -57,6 +58,7 @@ use tablepro_core::dialect::{SqlDialect, TablePaging};
use tablepro_core::meta::{RowIdentity, TableRef};
use tablepro_core::{ColumnInfo, FilterSet};
use tablepro_linux_platform::AppSettings;
use tablepro_linux_platform::settings::{DefaultSort, GridSortDirection};
use tablepro_session::operation::DeadlinePolicy;
use tablepro_session::runtime::{Tasks, WatchForwarder};
use tablepro_session::{LinkGeneration, Session};
Expand All @@ -70,6 +72,7 @@ use self::browse_tab_widgets::BrowseTabWidgets;
use self::column_recheck::ColumnRecheck;
pub(super) use self::columns_fetch::{ColumnFreshness, load_columns};
pub(crate) use self::data_input::DataInput;
pub use self::default_sort::InitialSort;
pub(crate) use self::grid_input::GridInput;
pub(crate) use self::page_reply::PageReply;
use self::page_state::PageState;
Expand Down Expand Up @@ -104,7 +107,7 @@ pub struct BrowseTabInit {
pub read_only: bool,
pub page_size: u64,
pub initial_offset: u64,
pub initial_sort: Option<(usize, bool)>,
pub initial_sort: InitialSort,
pub filter: TableFilter,
pub column_layouts: crate::persistence::ColumnLayoutStore,
pub filter_settings: crate::persistence::FilterSettingsStore,
Expand Down Expand Up @@ -147,7 +150,14 @@ impl BrowseTab {
let actions = browse_actions::install_browse_actions(&tab, init.page_size);
// A sort saved with the tab cannot reach an engine that reads
// in its own order.
let initial_sort = init.initial_sort.filter(|_| sorts_rows(dialect.as_deref()));
let preferences = init.settings.grid_preferences().snapshot();
let (initial_sort, default_sort) = match init.initial_sort {
InitialSort::Default => (
None,
Some((preferences.default_sort, preferences.default_sort_direction)),
),
InitialSort::Kept(sort) => (sort.filter(|_| sorts_rows(dialect.as_deref())), None),
};
let keys = KeysHandle::new(table.clone());
let grid = layout::grid(
&tab,
Expand Down Expand Up @@ -187,6 +197,7 @@ impl BrowseTab {
pager: BrowsePager::new(init.page_size, init.initial_offset),
deadlines: init.deadlines,
current_sort: initial_sort,
default_sort,
current_filter: initial_filter,
current_columns: Vec::new(),
page: None,
Expand Down Expand Up @@ -568,6 +579,9 @@ pub(crate) struct BrowseModel {
pager: BrowsePager,
deadlines: Arc<dyn DeadlinePolicy>,
current_sort: Option<(usize, bool)>,
/// What Preferences asked for when the tab opened, until the columns
/// say which column that is.
default_sort: Option<(DefaultSort, GridSortDirection)>,
/// The WHERE every page and count reads under, kept per connection,
/// schema and table.
current_filter: tablepro_core::FilterSet,
Expand Down
1 change: 1 addition & 0 deletions linux/crates/app/src/ui/browse_tab/paging_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ impl BrowseModel {
/// A sort the headers did not make, which they show too.
/// Read the first page in `next` order.
pub(super) fn sort_by(&mut self, next: Option<(usize, bool)>, fx: &mut Effects) {
self.default_sort = None;
// One header click can report the same sort twice.
if self.current_sort == next {
return;
Expand Down
Loading
Loading