-
Notifications
You must be signed in to change notification settings - Fork 83
feat(webui): Move run button under SQL query input; Modify SQL editor theming to look like AntD input. #1248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
3188d90
d9f2b74
c5f23d5
a810e09
9dca18f
8cf4126
b09c0ca
4e3e12b
a1f3f44
b7d6f9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| .status { | ||
| margin-left: 2px; | ||
| margin-top: 4px; | ||
| padding-top: 4px; | ||
| margin-bottom: -4px; | ||
| } | ||
|
|
||
| .badge { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,6 +9,7 @@ import styles from "./index.module.css"; | |||||||||||||
| import SqlQueryInput from "./Presto/SqlQueryInput"; | ||||||||||||||
| import SqlSearchButton from "./Presto/SqlSearchButton"; | ||||||||||||||
| import QueryInput from "./QueryInput"; | ||||||||||||||
| import QueryStatus from "./QueryStatus"; | ||||||||||||||
| import SearchButton from "./SearchButton"; | ||||||||||||||
| import TimeRangeInput from "./TimeRangeInput"; | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -23,30 +24,37 @@ const handleSubmit = (ev: React.FormEvent<HTMLFormElement>) => { | |||||||||||||
| }; | ||||||||||||||
|
|
||||||||||||||
| /** | ||||||||||||||
| * Renders controls for submitting queries. | ||||||||||||||
| * Renders controls for submitting queries and the query status. | ||||||||||||||
| * | ||||||||||||||
| * @return | ||||||||||||||
| */ | ||||||||||||||
| const SearchControls = () => { | ||||||||||||||
| return ( | ||||||||||||||
| <form onSubmit={handleSubmit}> | ||||||||||||||
| <div className={styles["searchControlsContainer"]}> | ||||||||||||||
| {SETTINGS_QUERY_ENGINE !== CLP_QUERY_ENGINES.PRESTO ? | ||||||||||||||
| ( | ||||||||||||||
| <> | ||||||||||||||
| {SETTINGS_QUERY_ENGINE !== CLP_QUERY_ENGINES.PRESTO ? | ||||||||||||||
| ( | ||||||||||||||
| <div> | ||||||||||||||
| <div className={styles["searchControlsContainer"]}> | ||||||||||||||
| {CLP_STORAGE_ENGINES.CLP_S === SETTINGS_STORAGE_ENGINE && <Dataset/>} | ||||||||||||||
| <QueryInput/> | ||||||||||||||
| <TimeRangeInput/> | ||||||||||||||
| <SearchButton/> | ||||||||||||||
| </> | ||||||||||||||
| ) : | ||||||||||||||
| ( | ||||||||||||||
| <> | ||||||||||||||
| <SqlQueryInput/> | ||||||||||||||
| </div> | ||||||||||||||
| <div className={styles["statusRow"]}> | ||||||||||||||
| <QueryStatus/> | ||||||||||||||
| </div> | ||||||||||||||
|
||||||||||||||
| <div className={styles["statusRow"]}> | |
| <QueryStatus/> | |
| </div> | |
| <div className={styles["buttonAndStatusRow"]}> | |
| <QueryStatus/> | |
| </div> |
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,6 @@ import { | |||||||||||||||||||||||||||||||||||||||||||||
| import styles from "./index.module.css"; | ||||||||||||||||||||||||||||||||||||||||||||||
| import {ProgressBar} from "./Presto/ProgressBar"; | ||||||||||||||||||||||||||||||||||||||||||||||
| import SearchControls from "./SearchControls"; | ||||||||||||||||||||||||||||||||||||||||||||||
| import SearchQueryStatus from "./SearchQueryStatus"; | ||||||||||||||||||||||||||||||||||||||||||||||
| import SearchResultsTable from "./SearchResults/SearchResultsTable"; | ||||||||||||||||||||||||||||||||||||||||||||||
| import SearchResultsTimeline from "./SearchResults/SearchResultsTimeline"; | ||||||||||||||||||||||||||||||||||||||||||||||
| import {useUpdateStateWithMetadata} from "./SearchState/useUpdateStateWithMetadata"; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -23,10 +22,7 @@ const SearchPage = () => { | |||||||||||||||||||||||||||||||||||||||||||||
| <> | ||||||||||||||||||||||||||||||||||||||||||||||
| {SETTINGS_QUERY_ENGINE === CLP_QUERY_ENGINES.PRESTO && <ProgressBar/>} | ||||||||||||||||||||||||||||||||||||||||||||||
| <div className={styles["searchPageContainer"]}> | ||||||||||||||||||||||||||||||||||||||||||||||
| <div> | ||||||||||||||||||||||||||||||||||||||||||||||
| <SearchControls/> | ||||||||||||||||||||||||||||||||||||||||||||||
| <SearchQueryStatus/> | ||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||
| <SearchControls/> | ||||||||||||||||||||||||||||||||||||||||||||||
| {SETTINGS_QUERY_ENGINE !== CLP_QUERY_ENGINES.PRESTO && <SearchResultsTimeline/>} | ||||||||||||||||||||||||||||||||||||||||||||||
| <SearchResultsTable/> | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
23
to
27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Minor readability: factor out the engine check to avoid repetition. Extracting a local useUpdateStateWithMetadata();
- return (
+ const isPresto = SETTINGS_QUERY_ENGINE === CLP_QUERY_ENGINES.PRESTO;
+ return (
<>
- {SETTINGS_QUERY_ENGINE === CLP_QUERY_ENGINES.PRESTO && <ProgressBar/>}
+ {isPresto && <ProgressBar/>}
<div className={styles["searchPageContainer"]}>
<SearchControls/>
- {SETTINGS_QUERY_ENGINE !== CLP_QUERY_ENGINES.PRESTO && <SearchResultsTimeline/>}
+ {false == isPresto && <SearchResultsTimeline/>}
<SearchResultsTable/>
</div>
</>
);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Avoid negative margins; prefer layout alignment over spacing hacks
Using a negative bottom margin to visually align text with the button can cause overlap with adjacent clickable areas and unpredictable wrapping. Consider aligning via flex and baseline instead of padding/margin tweaks.
Apply this diff to improve robustness:
.status { - margin-left: 2px; - padding-top: 4px; - margin-bottom: -4px; + margin-left: 2px; + padding-top: 4px; + margin-bottom: 0; + display: inline-flex; + align-items: baseline; /* aligns number with button text baseline */ + gap: 4px; }📝 Committable suggestion
🤖 Prompt for AI Agents