feat(viewer): stay quiet on incomplete/invalid filters while typing#122
Open
laurigates wants to merge 1 commit into
Open
feat(viewer): stay quiet on incomplete/invalid filters while typing#122laurigates wants to merge 1 commit into
laurigates wants to merge 1 commit into
Conversation
Running jaq on each keystroke means a half-typed filter (e.g. a trailing `|`) fails to parse, and the raw parser error — a `Debug` dump of jaq's internal structs — was flashed in the guide line on every keypress. `run_jaq` now returns a typed `JaqError` distinguishing parse/compile failures (`Invalid`, expected while typing) from runtime failures (`Execution`, a real problem on a well-formed filter). The viewer suppresses the guide message for `Invalid` and keeps the current view, so typing is quiet; genuine execution errors are still reported, now with a clean message instead of the debug dump. Partially addresses ynqa#63. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
Related PRs (no strict merge order) — #120, #121, and #122 are a small series of viewer / status-line improvements that independently edit the same 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.
Problem
jaq runs on each (debounced) keystroke, so a half-typed filter — e.g. ending in
|— fails to parse. The result was a rawDebugdump of jaq's internal parser structs flashing in the guide line on nearly every keypress:Two issues: the message is an internal
Debugrepresentation, and erroring at all on an incomplete expression (the normal state while typing) is noise.Fix
run_jaqnow returns a typedJaqError:Invalid— parse/compile failure (an incomplete or malformed expression, expected while typing).Execution— the filter parsed and compiled but failed at runtime (a real problem worth reporting).The viewer suppresses the guide message for
Invalidand leaves the view in place, so typing a multi-stage filter is quiet.Executionerrors are still reported, now with jaq'sDisplaymessage instead of theDebugdump.Notes
This is a lightweight take on #63 (don't choke on an incomplete expression): it stops the nagging without yet evaluating the longest valid prefix, which would be a larger change. Partially addresses #63.