Skip to content

feat(ios): show table rows in a grid as well as cards - #3963

Open
J2TeamNNL wants to merge 2 commits into
TableProApp:mainfrom
J2TeamNNL:feat/ios-row-grid
Open

J2TeamNNL wants to merge 2 commits into
TableProApp:mainfrom
J2TeamNNL:feat/ios-row-grid

Conversation

@J2TeamNNL

Copy link
Copy Markdown
Contributor

Summary

  • The iOS table browser can show rows in a grid: one line per row, a header pinned to the top, columns that scroll sideways, and the first column kept in view while they scroll.
  • A Cards / Grid picker sits in the browser's More menu. The choice is stored under com.TablePro.settings.rowLayout and applies to every table and window.
  • Default until a choice is made: regular width (iPad) opens in the grid, compact width (iPhone) keeps the cards. A choice the user makes wins at every width.
  • A tap on a grid row opens the same row detail view a card opens. The row context menu (share, copy, foreign keys) is the same. Swipe to delete does not exist outside a List, so the grid offers Delete Row in the context menu and as an accessibility action, under the same checks as the swipe.
  • Column widths come from the header and the first 50 rows, between 72 and 320 points, and scale with Dynamic Type.
  • Built from SwiftUI parts the app already uses: a two-axis ScrollView, a LazyVStack with a pinned section header, and onScrollGeometryChange to hold the first column in place. SwiftUI Table was not used: on iPhone it collapses to one column, and it does not scroll sideways.

Test plan

  • RowLayoutTests: the width default, a stored choice winning at both widths, the choice read back through AppStorage from an isolated defaults suite, and an unknown stored value falling back to the default.
  • RowGridMetricsTests: one width per column, the clamp, a longer value widening its column, NULL counting as its label, and only the first line of a value counting.
  • verify.sh ios RowLayoutTests RowGridMetricsTests DuoLayoutResolverTests DataBrowserViewModelTests: PASS, 61 tests.
  • verify.sh lint on every changed Swift file: PASS.
  • Checked on the iPhone 17 Pro and iPad Pro 11-inch simulators, light and dark, with the Chinook sample: switching layouts, scrolling sideways and down, and opening a row from the grid.

Before, iPhone (cards, unchanged and still the iPhone default):

Before

After, iPhone light: grid, scrolled sideways with the first column held, and the layout picker:

iPhone light

After, iPhone dark: grid, scrolled sideways, and the detail view a row opens:

iPhone dark

After, iPad light, grid by default:

iPad light

After, iPad dark, scrolled sideways:

iPad dark

Fixes #3933

The table browser gains a grid layout: one line per row, a pinned header, columns that scroll sideways and a first column that stays in view. A Cards / Grid picker in the More menu stores the choice; until one is made, regular width opens in the grid and compact width keeps the cards.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS: show table rows in a grid, not only as cards

1 participant