Skip to content

/-/jump: ?type= filtering, URL fields, hidden tables excluded, query titles - #3025

Open
simonw wants to merge 3 commits into
mainfrom
claude/nice-lamport-68r91m
Open

simonw wants to merge 3 commits into
mainfrom
claude/nice-lamport-68r91m

Conversation

@simonw

@simonw simonw commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Closes #3024

Changes to /-/jump

  • ?type= filtering. For example, ?type=table&type=database. The filter runs in SQL, so the 100-item limit and the truncated flag only count items of the requested types. It works alongside ?q=, and unknown types return no matches.

  • URL fields on every item. Each item now carries the datasette.urls arguments used to build its link, except format:

    • databases: database
    • tables and views: database and table
    • stored queries: database and query

    This also applies to plugin items whose url column is a JSON descriptor. These fields never overwrite the existing keys (name, url, type, description, display_name).

  • Hidden tables are excluded. This covers FTS shadow tables, tables with "hidden": true in config, _-prefixed tables and SpatiaLite internals.

  • Stored queries return their title as display_name. Search still matches query names only, not titles.

Example item:

{
  "name": "content: recent_comments",
  "display_name": "Recent comments",
  "url": "/content/recent_comments",
  "type": "query",
  "description": null,
  "database": "content",
  "query": "recent_comments"
}

New catalog_tables.hidden column

Hidden tables are now recorded in the internal catalog. The jump menu then excludes them with a plain join, rather than calling hidden_table_names() for every database on every request.

  • populate_schema_tables() sets hidden from db.hidden_table_names(). This runs whenever a database's schema version changes.
  • A new 0002_catalog_tables_hidden migration adds the column to existing internal databases.
  • _refresh_schemas() now fully repopulates the catalog on the first refresh after startup, even when schema versions match. That way a persistent --internal database picks up the new column values, and any config changes (such as hidden: true) made since the last run.

Docs and tests

Docs are updated in docs/introspection.rst and docs/plugin_hooks.rst. The internal schema in docs/internals.rst is regenerated with cog.

New tests cover:

  • type filtering, URL fields and query titles
  • FTS shadow tables and tables hidden in config, in the jump results and in the hidden column
  • runtime-created tables getting hidden set on refresh
  • migrating an older internal database

🤖 Generated with Claude Code

https://claude.ai/code/session_016BvfqCD4WXJZX8Nrxrf5AZ

Pass ?type=table&type=database to return only items of those types.
Filtering happens in SQL so the 100 item limit applies after filtering.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016BvfqCD4WXJZX8Nrxrf5AZ
- Items now include the datasette.urls arguments used to build their
  URL as fields, e.g. database/table for tables, database/query for queries
- Hidden tables (FTS shadow tables, hidden: true in config etc) are excluded
- Stored queries return their title as display_name

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016BvfqCD4WXJZX8Nrxrf5AZ
Comment thread datasette/default_jump_items.py Outdated
Comment on lines +19 to +24
hidden_tables = []
for database_name, db in datasette.databases.items():
hidden_tables.extend(
[database_name, table_name]
for table_name in await db.hidden_table_names()
)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This feels unnecessarily complex.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

We can add a hidden column to the catalog table instead.

@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (a8e13cc) to head (1c96364).

Files with missing lines Patch % Lines
datasette/views/special.py 0.00% 12 Missing ⚠️
datasette/utils/internal_db.py 0.00% 5 Missing ⚠️
datasette/app.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3025   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         78      78           
  Lines      13371   13386   +15     
=====================================
- Misses     13371   13386   +15     

☔ 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.

Replaces the per-request hidden_table_names() calls in the jump menu
with a hidden column on catalog_tables, calculated when the catalog is
populated. New 0002_catalog_tables_hidden migration adds the column to
existing internal databases, and the catalog is now fully repopulated
on the first refresh after startup so persistent internal databases
pick up the new column and any config changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016BvfqCD4WXJZX8Nrxrf5AZ

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.

The /-/jump endpoint should support selecting which types of content to return

2 participants