Repository navigation
fix: stop variables search from matching internal cell IDs - #11895
Merged
mscolnick merged 2 commits intoNov 17, 2026
Merged
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
mscolnick
approved these changes
Nov 17, 2026
Member
|
@burrows99 would you mind rebasing on main. It might resolve the CI issues. |
Contributor
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.25.3-dev416 |
Light2Dark
pushed a commit
that referenced
this pull request
Nov 23, 2026
**This pull request was authored by a coding agent.** ## 📝 Summary Closes #11896 The table search in the Data sources panel filtered on the raw search text. A trailing space (`orders `) emptied the list, and a search of only a space hid every table while the clear button stayed hidden, because that button already checks the trimmed value. `TableList` now trims the search before matching, the same way the schema and database expansion in `components/datasources/utils.ts` already does. A whitespace-only search shows every table, like an empty search, and `isSearching` follows the trimmed value too. Matching stays case-insensitive. `TableList` renders both the Python dataframes and the tables of each SQL schema, so both paths get the fix. ```mermaid flowchart TD A[Search tables for orders plus a space] --> B{Table list} B -->|Before| C[No tables shown] B -->|After| D[orders shown] ``` Narrated recording, before then after (sound on): https://github.com/user-attachments/assets/6795d57b-f46a-4885-9199-f9bfe7f66ccc ### Edge cases and unchanged behavior checked Checked in the running editor (Vite dev server and `marimo edit` from `main` at 9bdfb76, then this branch, same notebook with three polars dataframes) and shown in the recording: - Before: `orders` lists `orders`; `orders ` lists nothing; a single space lists nothing and shows no clear button. - After: `orders ` lists `orders`; a single space lists all three tables. - Edge case: leading spaces and capitals (` ORDER`) list `orders` and `order_items`. - Edge case: spaces on both sides (` customers `) list `customers`. - Unchanged: a search with no match (`invoices`) lists no tables. - Unchanged: the clear button empties the search and restores every table. - Unchanged: the Variables search below the Data sources section still filters variables. Covered by tests only: the SQL schema tables path, which renders the same `TableList`. ### Tests - `vitest run src/components/datasources/__tests__/table-list.test.tsx`: 6 passed. The two new tests fail on `main` (trailing and leading whitespace, whitespace-only search) and pass on this branch. - `vitest run src/components/datasources/`: 9 files, 82 tests passed. - `oxfmt --check` and `oxlint` on the two changed files: clean. - Not run: the full frontend suite, `make check` and the typecheck. AI assistance (Claude Code) was used for this change; the bug was reproduced and the fix verified manually in the running editor. ## 👋 First time contributor introduction Hi, I'm Raunak, an AI software engineer in London with an MSc in Artificial Intelligence and about five years of production engineering, mostly Python and TypeScript. I build LLM agent systems and the evaluation pipelines around them. My first marimo PR is #11895. ## 📋 Pre-Review Checklist <!-- These checks need to be completed before a PR is reviewed --> - [x] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). Not applicable: a small bug fix with no API change. - [x] Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it. - [x] Video or media evidence is provided for any visual changes. <!-- PR is more likely to be merged if functionality is tested thoroughly --> ## ✅ Merge Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [x] Documentation has been updated where applicable, including docstrings for API changes. No documentation covers this behavior. - [x] Tests have been added for the changes made. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request was authored by a coding agent.
📝 Summary
The search box in the Variables panel also matches the internal IDs of the cells that declare or use a variable. Those IDs are four random letters and are never shown, so a search returns variables that have nothing visibly in common with what was typed.
To reproduce, open a notebook with at least seven cells and search for
ref(the seventh cell's ID isXref):On
main,reflistsmo,reference,Totalandsummary. Onlyreferencecontains those letters; the other three are declared in or used by the cell with IDXref. IDs are generated from a fixed seed when a notebook is loaded, so the first cell isHbolandbolmatches every variable of the first cell.The cause is
globalFilterFn: "auto". It stringifies each column's accessor value, and those values are arrays that hold the cell IDs next to the text.The fix replaces it with a small function that searches what the table shows: variable name, type, value, and the names of the declaring and using cells. The cell names were already added for searching; they move from the column accessor into that function. Matching stays case-insensitive.
I did not find an existing issue or pull request for this. I noticed it while using the panel in a local editor.
flowchart TD A[Seventh cell has hidden ID Xref] --> B{Search variables for ref} B -->|Before| C[Four variables listed] B -->|After| D[Only reference listed]Narrated recording, before then after (sound on):
evidence.mp4
Edge cases and unchanged behavior checked
Checked in the running editor (Vite dev server and
marimo editfrommainat9bdfb76, then this branch, same notebook) and shown in the recording:reflistsmo,reference,Totalandsummary.reflists onlyreference.XREF) finds nothing. Onmainit listsmo,Totalandsummary.TOTAL) still findsTotalandsubtotal.order) still findsreference.cell-6) still listsmo,Totalandsummary.The last four searches return the same rows on
main; I ran them there too, outside the recording.Checked by the new component tests only (
variables-table.test.tsx):float), by a custom cell name, and by the ID of the first cell (Hbol).Tests run
With the change to
variables-table.tsxreverted and the tests kept, the ID test fails:expected [ 'reference', 'Total', 'summary' ] to deeply equal [ 'reference' ].oxfmt --checkandoxlintpass on the two changed files, andtsgo(the frontend typecheck) reports nothing.Not run: the full frontend suite, the Python tests, the end-to-end suite and a production frontend build.
👋 First time contributor introduction
Hi, I'm Raunak, an AI software engineer in London with an MSc in Artificial Intelligence and about five years of production engineering, mostly Python and TypeScript. I build LLM agent systems and the evaluation pipelines around them. This is my first contribution to marimo.
📋 Pre-Review Checklist
✅ Merge Checklist
AI tools (Claude Code) assisted with this change; the bug was reproduced and the fix verified manually in the running app.
🤖 Generated with Claude Code