Skip to content

Redesigned homepage: one searchable catalog of tables, views and queries - #3049

Merged
simonw merged 12 commits into
mainfrom
homepage-prototype
Nov 8, 2026
Merged

simonw merged 12 commits into
mainfrom
homepage-prototype

Conversation

@simonw

@simonw simonw commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

A redesigned homepage:

  • No longer focuses on database grouping - shows all tables and a truncated list of queries
  • You can search to live update the page, a bit like the Jump menu but more homepagey
  • JavaScript plugins can add to the homepage
  • Recent visits to pages/queries/views/databases are now recorded in localStorage so homepage can show them (and jump menu too, which used to only record most recently navigated to via the jump menu)
CleanShot 2026-11-07 at 11 32 50 PM@2x
Claude Opus 5.5 Medium

What's on the page

  • Search box, focused when the page loads. It matches table and view names, column names, table descriptions, and the titles, descriptions and SQL of stored queries. Results update as you type, through /?_fragment=results. Up/down and Enter move through the results and open one, and / in the empty box still opens Jump to.
  • Plugin sections from a new makeHomepageSections() JavaScript plugin hook. It uses the same section shape as makeJumpSections(), plus an optional title.
  • Recently visited: tables, views, queries and databases you've opened, recorded in localStorage by a small recent.js, kept separate for each signed-in user, and ranked by how often and how recently you visited. Jump to's "Recent" list now reads the same history instead of only remembering picks from the dialog.
  • Database filter buttons (?database=), shown when more than one database is attached.
  • Queries: queries from config and plugins, then your own saved queries, five at most, with a link to /-/queries. Other people's saved queries only appear in search results.
  • Tables and views from every database in one list, built by SQL against the internal catalog_* tables so it stays fast with thousands of tables. Hidden tables are left out using catalog_tables.hidden. Results are paged 30 at a time, with links that jump back to #tables.

While you search, the other sections are hidden. Matching tables and views come first, then matching queries, then "Other matches": items plugins add with jump_items_sql, such as datasette-apps apps, through a new reusable JumpView.matches().

Compatibility

  • /.json is unchanged.
  • The index.html template context has changed. It's now documented as IndexContext in docs/template_context.rst and checked by the contract tests. Custom index.html templates that relied on the old keys, such as tables_and_views_truncated or table_rows_sum, will need updating.
  • Results only include tables, views and queries the actor has permission to see.

Tests and docs

  • New tests/test_homepage.py, plus Playwright tests for recent visits, keyboard navigation, the / shortcut and plugin sections. The old homepage tests are rewritten for the new markup.
  • Docs updated in pages.rst, template_context.rst, custom_templates.rst, javascript_plugins.rst (the new makeHomepageSections() hook) and plugin_hooks.rst.

There's a companion change in datasette-agent, on its homepage-section branch: it adds a "Datasette Agent" chat box to the homepage using the new hook, with # tagging there and in the Jump to menu.

🤖 Generated with Claude Code

simonw and others added 6 commits November 7, 2026 15:12
Homepage now lists every table and view across all databases in one
paginated list built from the internal catalog tables, with live search
over names, descriptions, columns and stored queries, a database filter,
a queries section and a new makeHomepageSections() JS plugin hook.

/.json is unchanged. Existing homepage HTML tests still need updating.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- recent.js records table, view, query and database visits in localStorage;
  Jump to's Recent list and a homepage Recently visited section read it
- Queries show as compact rows: config/plugin queries, then your own
- Searching hides the other sections; matching queries follow the tables
- Live search fetches /?_fragment=results instead of the whole page
- Labelled database filter, table-page style pagination
- makeHomepageSections() sections can pass a title

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces a hidden_table_names() call per database on every page load
with a join against the hidden flag now stored in the catalog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Rewrite homepage HTML and permission tests for the new layout
- Single-database homepage links to the database from the summary line
- Up/down/Enter navigate search results, with a clear highlight
- Search box is focused on load; / in the empty box opens Jump to
- Pagination links jump to #tables

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Homepage search includes items plugins add with jump_items_sql (apps,
  for example) under Other matches, via a reusable JumpView.matches()
- Fix empty Recently visited heading showing with no history
- Homepage actions sit below the title
- New tests/test_homepage.py and Playwright tests for recent visits,
  keyboard navigation, the / shortcut and makeHomepageSections
- Documented IndexContext template context, covered by contract tests
- Homepage docs in pages.rst, partial templates in custom_templates.rst

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonw simonw added the design label Nov 8, 2026
@simonw

simonw commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

I'm not yet entirely happy with this, it feels a little Claude-y, but it's SO MUCH better than what we have at the moment:-

CleanShot 2026-11-07 at 11 36 43 PM@2x

@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 227 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (c92b7ed) to head (2117a55).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
datasette/homepage.py 0.00% 106 Missing ⚠️
datasette/views/index.py 0.00% 79 Missing ⚠️
datasette/views/stored_queries.py 0.00% 30 Missing ⚠️
datasette/views/special.py 0.00% 11 Missing ⚠️
datasette/template_contexts.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #3049    +/-   ##
======================================
  Coverage   0.00%   0.00%            
======================================
  Files         78      79     +1     
  Lines      13661   13869   +208     
======================================
- Misses     13661   13869   +208     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@simonw

simonw commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Claude described it in the documentation here:

https://github.com/simonw/datasette/blob/95bfe3ddb0ec552db3cb263cfe4d7985ed02d74c/docs/pages.rst#top-level-index

That's going to need some cleanup and a screenshot.

simonw and others added 6 commits November 7, 2026 23:39
Table cards show how many other tables they link to or are linked from
by foreign keys, with the names in a tooltip, limited to tables the
actor can see. The row count moves to the meta line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The global and per-database query lists now use the homepage's search
box, chips and compact query rows:

- Live search with ?_fragment=results, sharing homepage.js: up/down and
  Enter pick a query, Escape clears. On these pages the arrow keys work
  even with an empty search box.
- Database chips with matching counts that keep the current search.
- Mode and visibility filters as chips, shown only when they offer a
  choice.
- Rows show database, description or SQL, inputs (read from the SQL
  when not declared) and owner, tagged yours, writes, private, or
  trusted for non-config queries.
- Homepage-style pagination footer.

Also de-duplicates inputs derived from SQL on the homepage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cursor does not record how far into the list it is, so HTML Next
links now carry ?_start= and the footer reads "Showing 21-40 of 87".
The last page keeps the footer without a Next link. The JSON API's
next_url is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonw simonw added this to the Datasette 1.0 stable milestone Nov 8, 2026
@simonw
simonw merged commit 3cdf2b9 into main Nov 8, 2026
13 checks passed
@simonw
simonw deleted the homepage-prototype branch November 8, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant