Repository navigation
Find in the diagram, from the palette's loupe (stage 8.4) - #266
Merged
Merged
Conversation
The loupe opens a box at the top of the palette that finds nodes in the model, not in the drawing, so a node off screen or too small to be drawn is found too. Ported from mlir-viewer's search and made neutral: - a node matches by its name (cal:entityName, or a frame's label) and by the text a producer adds (wf:searchText, one text or a text per field); - a root that names fields (wf:searchFields) gets a tab per field, and a query can be a regular expression; - with one node selected that holds others, the search stays inside it, and a hit that find selected itself does not become the scope; - a row ends with the name of the node around the match, or its line inside a scope of that name, and wf:searchDetail tells like rows apart; - a click or Enter selects the hit and centres it where names are drawn at the zoom, else fits it no closer than 1:1. In a palette that lists tools the same text filters the tools, as GLSP's field did. The view options are no longer filtered, and the palette no longer says "No results found.": find says what it matched. GLSP draws a new body on every filter, so the palette puts the focus back in the query after it. Claude-Session: https://claude.ai/code/session_01EToj6NxqLABK3H5cucHNsY
- The × of the chip left the scope only until the next search: the node stays selected until the action that deselects it is handled. Its selection is now no scope until the reader selects something else. - Enter went to the first match of the text as it was before the last keys. It searches first. - The chip and the matches did not follow a click in the diagram while the box was open. The palette refreshes find on a selection change, and a search with the same answer leaves the rows, and the focus on one, alone. - A node find revealed was never a scope again. It is one once the reader has selected something else and comes back to it. A scope is also kept while the action of a reveal is not handled yet. - A root that names one field got no tab and a search of that field alone. It now matches every text, as the doc of wf:searchFields says. - A search inside a node listed the node itself. It starts at what the node holds. - The palette drew its whole body again at every key. It is told the text with the search, after the pause. Claude-Session: https://claude.ai/code/session_01EToj6NxqLABK3H5cucHNsY
The palette searched again when the action that brings a model was handled, which is before its root is in place: the search was of the model being replaced, and nothing searched the new one. Found live in mlir-viewer, where a block expanded with find open kept "no matches". Find now searches again on the editor context's model root change. Claude-Session: https://claude.ai/code/session_01EToj6NxqLABK3H5cucHNsY
A hit is centred where it can be read at the zoom shown, else fitted. That zoom is the one names are drawn from. A product whose matches are read in the detail of a node (mlir-viewer: a value in a row of the body) overrides ViewToolPalette.findReadableZoom, so that a hit is not centred on a box that does not show what matched. Claude-Session: https://claude.ai/code/session_01EToj6NxqLABK3H5cucHNsY
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.
Stage 8.4 of the mlir-viewer convergence plan (
mlir-viewer/docs/plans/dialogram-stage-8-plan.md): the palette's loupe opens find in the diagram, in every product. Ported from mlir-viewer'spalette-search.tsand made neutral. The mlir-viewer pull request that feeds it and deletes its own search follows.What the reader sees
.*toggle, a tab per field where the root names fields, the count, and the matches.ViewToolPalette.findReadableZoom).What a producer gives
wf:searchTexton a node: one text, matched with the name, or a text per field. A field namednamestands for the name of the node.wf:searchDetailon a node: shown beside a match, so that like rows can be told apart (mlir: the value an operation defines).wf:searchFieldson the root:[{ key, label, title? }], one tab each.cal:entityName, or a frame by its label, and the row ends with its line fromcal:sourceRange.Changed
Checked
/code-review medium: seven findings, all fixed in the second commit (the × against an action handled later, Enter before the search, the selection followed, a revealed node as a scope again, one field without a tab, the scope's own node listed, the body drawn at every key).diagram-find.test.ts, 36 tests: matching by name, field, text and expression; scope, including a leaf selected and a hit find selected; rows, count, detail and line; the box (tabs, Enter, Escape, clearing the scope); the palette (loupe, tool filter with the focus kept, reveal by zoom); the stylesheet. The focus test fails without the fix.10_parallel_agents, harness on 9338): "keyw" finds keywords, the tools filter out, Enter selects and centres it with the caret kept in the query, the next query stays in view, Escape gives the 12 tools back. The mlir checkpoint (arith.constantinside an isolated function onTop_SW_array.llvm.mlir) comes with the mlir-viewer pull request.https://claude.ai/code/session_01EToj6NxqLABK3H5cucHNsY