You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2023/07/31 16:43:39 UTC
[GitHub] [superset] justinpark opened a new pull request, #24847: fix(sqllab): Add docText for long keyword
justinpark opened a new pull request, #24847:
URL: https://github.com/apache/superset/pull/24847
### SUMMARY
Since the keyword tooltip is fixed size, a longer keyword name will be collapsed.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
After:
https://github.com/apache/superset/assets/1392866/cc936b09-9473-48d6-a465-4046e9b016ec
Before:

### TESTING INSTRUCTIONS
Go to SQL Lab and enable autocomplete
Please select a schema including a long table name
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] michael-s-molina commented on a diff in pull request #24847: fix(sqllab): Add docText for long keyword
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on code in PR #24847:
URL: https://github.com/apache/superset/pull/24847#discussion_r1280705258
##########
superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.ts:
##########
@@ -50,6 +50,11 @@ const EMPTY_LIST = [] as typeof sqlKeywords;
const { useQueryState: useSchemasQueryState } = schemaEndpoints.schemas;
const { useQueryState: useTablesQueryState } = tableEndpoints.tables;
+const getHelperText = (value: string) =>
+ value.length > 30 && {
+ docText: value,
Review Comment:
Should you add this property to the [Typescript definition](https://github.com/apache/superset/blob/ea17dd637c9259236292d7d81887e59f0f14eacc/superset-frontend/src/components/AsyncAceEditor/index.tsx#L54)?
##########
superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.ts:
##########
@@ -50,6 +50,11 @@ const EMPTY_LIST = [] as typeof sqlKeywords;
const { useQueryState: useSchemasQueryState } = schemaEndpoints.schemas;
const { useQueryState: useTablesQueryState } = tableEndpoints.tables;
+const getHelperText = (value: string) =>
+ value.length > 30 && {
Review Comment:
Is it possible to make this dynamic and controlled by the UI instead of a fixed 30 length? Does the component offer something the possibility of overriding the popup options so you can render them with a custom component that displays a tooltip when truncated? If this is possible, it would also resolve the different theming issue.
##########
superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.test.ts:
##########
@@ -267,3 +267,49 @@ test('returns column keywords among selected tables', async () => {
),
);
});
+
+test('returns long keywords with docText', async () => {
Review Comment:
Is it possible to add a test to `AsyncEditorWrapper` and test the user interaction such as hovering an item and check that the tooltip will appear? RTL recommends [avoiding tests for implementation details](https://testing-library.com/docs/#what-you-should-avoid-with-testing-library) as they can change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] justinpark commented on a diff in pull request #24847: fix(sqllab): Add docText for long keyword
Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark commented on code in PR #24847:
URL: https://github.com/apache/superset/pull/24847#discussion_r1281045666
##########
superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.test.ts:
##########
@@ -267,3 +267,49 @@ test('returns column keywords among selected tables', async () => {
),
);
});
+
+test('returns long keywords with docText', async () => {
Review Comment:
The one of the main reason I introduced useKeywords hook is this. It's hard to render AceEditor in testing library due to the complex dependancies.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] codecov[bot] commented on pull request #24847: fix(sqllab): Add docText for long keyword
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #24847:
URL: https://github.com/apache/superset/pull/24847#issuecomment-1658878148
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#24847](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (088117e) into [master](https://app.codecov.io/gh/apache/superset/commit/e2d5046bb7ac34fa6b8e0ba4c2a03a51756cf3d5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (e2d5046) will **increase** coverage by `0.00%`.
> Report is 5 commits behind head on master.
> The diff coverage is `98.52%`.
> :exclamation: Current head 088117e differs from pull request most recent head ff73612. Consider uploading reports for the commit ff73612 to get more accurate results
```diff
@@ Coverage Diff @@
## master #24847 +/- ##
=======================================
Coverage 68.99% 68.99%
=======================================
Files 1903 1904 +1
Lines 74072 74083 +11
Branches 8193 8194 +1
=======================================
+ Hits 51107 51117 +10
- Misses 20844 20845 +1
Partials 2121 2121
```
| Flag | Coverage Δ | |
|---|---|---|
| javascript | `55.83% <100.00%> (+<0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Files Changed](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [superset/utils/backports.py](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvdXRpbHMvYmFja3BvcnRzLnB5) | `83.33% <83.33%> (ø)` | |
| [.../SqlLab/components/AceEditorWrapper/useKeywords.ts](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL0FjZUVkaXRvcldyYXBwZXIvdXNlS2V5d29yZHMudHM=) | `80.76% <100.00%> (+0.76%)` | :arrow_up: |
| [superset/charts/commands/importers/v1/utils.py](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY2hhcnRzL2NvbW1hbmRzL2ltcG9ydGVycy92MS91dGlscy5weQ==) | `91.66% <100.00%> (ø)` | |
| [superset/common/chart\_data.py](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29tbW9uL2NoYXJ0X2RhdGEucHk=) | `100.00% <100.00%> (ø)` | |
| [superset/common/db\_query\_status.py](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29tbW9uL2RiX3F1ZXJ5X3N0YXR1cy5weQ==) | `100.00% <100.00%> (ø)` | |
| [superset/connectors/base/models.py](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9iYXNlL21vZGVscy5weQ==) | `87.22% <100.00%> (ø)` | |
| [superset/constants.py](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29uc3RhbnRzLnB5) | `100.00% <100.00%> (ø)` | |
| [superset/databases/api.py](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2FwaS5weQ==) | `89.90% <100.00%> (ø)` | |
| [superset/errors.py](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvZXJyb3JzLnB5) | `94.44% <100.00%> (ø)` | |
| [superset/key\_value/types.py](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQva2V5X3ZhbHVlL3R5cGVzLnB5) | `90.62% <100.00%> (ø)` | |
| ... and [8 more](https://app.codecov.io/gh/apache/superset/pull/24847?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] justinpark commented on a diff in pull request #24847: fix(sqllab): Add docText for long keyword
Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark commented on code in PR #24847:
URL: https://github.com/apache/superset/pull/24847#discussion_r1281147704
##########
superset-frontend/src/SqlLab/components/AceEditorWrapper/useKeywords.ts:
##########
@@ -50,6 +50,11 @@ const EMPTY_LIST = [] as typeof sqlKeywords;
const { useQueryState: useSchemasQueryState } = schemaEndpoints.schemas;
const { useQueryState: useTablesQueryState } = tableEndpoints.tables;
+const getHelperText = (value: string) =>
+ value.length > 30 && {
Review Comment:
@michael-s-molina
Unfortunately it's very complicated to make the tooltip dynamically.
First, ace-editor doesn't provide the enough apis to handle the tooltip dynamically. (it's virtualized list so it should calculate the each item width dynamically as typed.)
To make the solution simple, it uses the static length since the tooltip width is fixed size (260px) and we can mostly guarantee the 30 characters are approaching the max. width(260px).
In my personal opinion, we can add `docText` for all cases to be consistence/simple for UX.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org