Repository navigation
fix(editor): a filling code editor starts its text at the top - #1447
Merged
Merged
Conversation
QueryaCodeEditor did not pass textAlignVertical to the shadcn field, and the field centres the text of one that expands, so the placeholder and the first line of the SQL editor sat in the middle of the pane. A filling editor now aligns to the top unless textAlignVertical says otherwise; tests check the caret position for both variants and an explicit alignment.
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.
Found while driving a build of `dev` (UI consistency review): in the SQL editor the placeholder and the first line of text sat in the vertical middle of the pane.
Cause
`QueryaCodeEditor` did not pass `textAlignVertical` to the shadcn field, and the field centres the text of one that expands. The material variant had the same default.
Change
A filling editor (`expands: true`) aligns its text to the top unless `textAlignVertical` is given; both variants use the same getter.
Tests
`querya_code_editor_alignment_test`: the caret of an empty editor is near the top for the shadcn and material variants, and an explicit `TextAlignVertical.center` still centres.
Not run locally; CI is the check.