Resize Web UI textarea for slight query overflow#105713
Open
itsjoeoui wants to merge 5 commits into
Open
Conversation
Member
|
Will it activate on page load? |
Author
Ah I missed that, it should be fixed now. 😄 I tested with something like http://127.0.0.1:8123/programs/server/play.html#U0VMRUNUIDAKU0VMRUNUIDEKU0VMRUNUIDIKU0VMRUNUIDMKU0VMRUNUIDQKU0VMRUNUIDUKU0VMRUNUIDYKU0VMRUNUIDcKU0VMRUNUIDgKU0VMRUNUIDk= and it is working. |
alexey-milovidov
approved these changes
May 24, 2026
Contributor
|
Workflow [PR], commit [6ba28e3] Summary: ❌
AI ReviewSummaryThis PR adds Final VerdictStatus: ✅ Approve |
45c8fb5 to
970681b
Compare
The Web UI `play.html` query editor kept its fixed height even when the query was only slightly taller than the visible `textarea`, forcing scrolling for small overflows. Add `resizeQueryAreaIfSlightlyOverflowing`, which compares the editor required `scrollHeight` with the current height and grows the editor only when the required height is at most 30% larger. Larger pasted queries remain scrollable so the editor does not jump to a large size. Closes ClickHouse#105709
The `textarea` resize belongs to the query editor input flow, not to `updateQueryParams`, whose job is query parameter and highlighting state. Move the `resizeQueryAreaIfSlightlyOverflowing` call into the `query_area` `input` listener so the behavior still runs for typing, pasted text, and programmatic changes that dispatch `input`.
Hash restore sets the query before the `input` listener is installed, so moving the resize into the listener alone did not cover initial page load. Introduce `updateQueryArea` as the shared resize-and-update helper, use it for history restore and the initial query setup path, and leave normal edits wired through the `input` listener.
Keep `updateQueryParams` focused on parameters and highlighting. The textarea resize is now explicit at editor value-change entry points that need it: history restore, input events, and initial page-load setup. This preserves page-load resizing without introducing a mixed `updateQueryArea` helper.
Restore the previous `input` dispatch calls for history and hash restore. They are not needed for the textarea resize feature, so keep the PR diff focused on the resize helper and the explicit resize calls for input and page-load query setup.
970681b to
6ba28e3
Compare
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.
Allow the Web SQL UI query editor in
play.htmlto grow when the query is only slightly taller than the currenttextarea. This keeps small overflows visible while leaving much larger pasted queries scrollable.Closes #105709
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The Web SQL UI now expands the query editor when a query is at most 30% taller than the current editor height.
Documentation entry: