Skip to content

feat(frontend): suppress kernel-dependent table controls in static export - #10007

Merged
kirangadhave merged 1 commit into
mainfrom
kg/static-table-suppress-controls
Jun 27, 2026
Merged

kirangadhave merged 1 commit into
mainfrom
kg/static-table-suppress-controls

Conversation

@kirangadhave

@kirangadhave kirangadhave commented Jun 26, 2026 •

Copy link
Copy Markdown
Member

📝 Summary

In a static HTML export, mo.ui.table renders chrome backed by live-kernel RPCs that silently no-op when used: search, filters, column summaries, sorting, pagination, row/cell selection, the chart builder, and the row/column explorers. The table looks interactive but isn't. The frontend now detects isStaticNotebook() at render time and hides those controls, so an exported table exposes only what works without a kernel.

The entire top bar is hidden (search, filters access, chart builder, explorers, download, size), pagination is dropped from the bottom bar, the column summaries RPC is skipped, and the selection column is removed. Controls that need no kernel stay: the row and column counts, client-side cell-selection stats, and data-type badges. Download is hidden along with the top bar because download_as is itself a kernel RPC and does not resolve in a static export, so the issue's note that download is unaffected does not hold in practice.

Because a static export only embeds the first page, a banner now reports how many rows are visible out of the total and points authors at page_size to embed more.

Verified against a real marimo export html snapshot and covered by frontend tests that mock isStaticNotebook().

Static table

Closes MO-6534, #9387
Screenshot 2026-06-26 at 3 23 51 PM

Review in cubic

@vercel

vercel Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jun 26, 2026 10:42pm

Request Review

@kirangadhave
kirangadhave marked this pull request as ready for review June 26, 2026 22:33
Copilot AI review requested due to automatic review settings June 26, 2026 22:33
@kirangadhave kirangadhave added the enhancement New feature or request label Jun 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the static HTML export experience for mo.ui.table by hiding or disabling table controls that depend on a live kernel (RPC-backed), preventing exported tables from appearing interactive when they cannot actually perform those actions.

Changes:

  • Skip column-summaries RPCs and suppress selection behaviors when rendering in isStaticNotebook() mode.
  • Hide the table top bar and disable sorting/filtering in static mode; hide pagination controls in the bottom bar.
  • Add frontend test coverage for static-mode control suppression by mocking isStaticNotebook().

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
frontend/src/plugins/impl/DataTablePlugin.tsx Detect static notebook mode to skip kernel RPCs (column summaries), suppress selection, and show a truncation banner.
frontend/src/plugins/impl/tests/DataTablePlugin.test.tsx Add tests that verify kernel-dependent controls are present in normal mode and suppressed in static mode via a mock.
frontend/src/components/data-table/TableBottomBar.tsx Hide pagination UI in static mode (pagination requires kernel-backed page fetches).
frontend/src/components/data-table/data-table.tsx Hide top bar and disable sorting/filtering in static mode to avoid non-functional UI in exports.

Comment thread frontend/src/plugins/impl/__tests__/DataTablePlugin.test.tsx
Comment thread frontend/src/plugins/impl/DataTablePlugin.tsx Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Architecture diagram
sequenceDiagram
    participant Reader as Static HTML Reader
    participant Table as DataTableComponent
    participant Static as isStaticNotebook()
    participant TopBar as TableTopBar
    participant BottomBar as TableBottomBar
    participant ColumnSum as Column Summaries (RPC)
    participant ReactTable as React Table State
    participant Banner as Truncation Banner

    Note over Reader,Banner: Static Export Rendering Flow

    Table->>Static: Check isStaticNotebook()
    Static-->>Table: true

    alt Static Export
        Table->>TopBar: hide entire top bar (search, filters, chart, explorers, download, size)
        Table->>ReactTable: enableSorting = false
        Table->>ReactTable: enableColumnFilters = false

        Table->>BottomBar: hide pagination controls
        Table->>ColumnSum: skip fetchColumnSummaries()
        Columnum-->>Table: not called (RPC never sent)

        Table->>ReactTable: clear selection = null
        Table->>Banner: show "Showing X of Y rows. Increase page_size..."
        Banner-->>Reader: visible message

        Note over Table: Client-side only features remain active
        Note over Table: data-type badges, row/column counts, cell-selection stats
    else Normal (Live Kernel)
        Table->>TopBar: render full toolbar
        Table->>BottomBar: render pagination
        Table->>ColumnSum: fetch via kernel RPC
        Table->>ReactTable: enable all interactions
    end
Loading

Re-trigger cubic

…port

Hide table chrome backed by live-kernel RPCs (search, filters, column
summaries, sorting, pagination, selection, chart builder, explorers, download)
when isStaticNotebook() is true, and add a banner reporting visible-vs-total
rows. Controls that work without a kernel are unaffected.

@mscolnick mscolnick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice

@kirangadhave
kirangadhave merged commit d1cac32 into main Jun 27, 2026
30 checks passed
@kirangadhave
kirangadhave deleted the kg/static-table-suppress-controls branch June 27, 2026 01:41
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.12-dev10

williambdean pushed a commit to williambdean/marimo that referenced this pull request Sep 6, 2026

This branch was successfully deployed

1 active deployment
Preview — 99033797 Deployed Jun 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants