Skip to content
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

Frontend enhancements #80

Merged
merged 12 commits into from
Jun 17, 2020
Merged

Frontend enhancements #80

merged 12 commits into from
Jun 17, 2020

Conversation

benj-zen
Copy link
Collaborator

@benj-zen benj-zen commented Jun 3, 2020

  • Fixes layout for large tables
  • Adds Welcome page
  • Adds routing and URL params
  • Makes QueryTable sortable
  • Adds dark/light mode toggle
  • Refactors framework for adding new views
  • Updates favicon
  • Adds option to export data as csv or json

benj-zen added 2 commits June 2, 2020 11:53
- Fixes layout for large tables
- Adds Welcome page
- Adds routing and URL params
- Adds dark/light mode toggle
- Refactors framework for adding new views
@benj-zen benj-zen force-pushed the frontend_enhancements branch from 246ebc6 to 4a8b96e Compare June 3, 2020 10:40
@benj-zen benj-zen marked this pull request as ready for review June 4, 2020 08:47
@benj-zen benj-zen requested a review from a team as a code owner June 4, 2020 08:47
Copy link
Contributor

@dingens dingens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(copied from slack) irgendwie bin ich nicht damit zufrieden dass man für die hauptoperation (query) dieses kleine versteckte menü anklicken muss. das ist irgendwie das gegenteil von guter ux. finden wir da nicht was besseres? vllt doch tabs und wir bemühen uns uns damit extrem kurz zu fassen (ggf zusatzinfo per mouseover) damit es immer in eine zeile passt?

Also, I'd like to rename pqdb-frontend to just frontend (or web-frontend, maybe)

pqdb-frontend/src/App.js Outdated Show resolved Hide resolved
<ThemeProvider theme={getTheme(this.state.themeId)}>
<CssBaseline />
{this.state.lightBoxIsOpen && (
<Lightbox
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think it'd be more helpful if the diagram wasn't shown in an overlay but right below the sql query field, so that one can type queries while looking at it. (It'd be enough if this was possible on the sql page, it's not important on the welcome page. There, we should rather have a simple diagram telling people what scheme/flavor etc is.)

Also, the icon could be a link to the image so if you middle-click it you can open the image in another tab.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you display the image below the query field it will be too small to read. I chose the lightbox since it had zooming functionality.
An alternative would be to display the image below the query field and to magnify the content at the cursor position.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like!

Another idea (but way more work): split the big diagram into five, one for scheme_, one for flavor_, etc. This is the natural way of splitting the diagram in parts: Each of them would just have one arrow which leaves the diagram in the direction of the "one level up" table (except benchmark where it's two)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works well for me! It'd be great if we could set a max height to the image so that it is never larger than say 80% of the screen so the query box is always above, but it doesn't seem to be possible (setting the style property sets it on the outer div, not on the image)

for really small displays, it's probably not very usable, but that's probably not solvable no matter what (and nobody wants to write queries on a smartphone anyways)

value={this.state.sqlQuery}
onChange={e => this.setState({ sqlQuery: e.target.value })}
value={this.state.sqlInput}
onChange={e => this.setState({ sqlInput: e.target.value })}
/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this resizable?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've found out we need CSS resize: vertical but where is the css file? (yeah I need to get into react :) just leaving this here for now though)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove the 'rows' property, then it will autosize.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or use 'rowsMax'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autosize depending on the content? sounds good. But I'd still allow manual resizing because why not let users work the way they want. (And I'd not set a maximum height. Let users do what they want)

basically, like this field here: grow when you enter more, but allow manual resizing. (They seem to stop autoresizing at about 80% of the screen height. That's sensible probably, but probably not worth the effort)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it just resizes to fit. That's enough I'd say.

Btw I think I found out how to use style. You need to pass a js object, and use the JS camelCase style names, like so:
style={{ backgroundColor: 'red' }}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's how it works. However, the material components ignore the style property, because they use their own styling system.

pqdb-frontend/src/App.js Outdated Show resolved Hide resolved
pqdb-frontend/src/components/views.js Outdated Show resolved Hide resolved
pqdb-frontend/src/components/views.js Outdated Show resolved Hide resolved
pqdb-frontend/src/components/views.js Outdated Show resolved Hide resolved
pqdb-frontend/src/components/views.js Outdated Show resolved Hide resolved
benj-zen added 3 commits June 15, 2020 11:19
- Autofocus for TextField
- History push instead of replace (also fixes double query execution)
- Show indicator when query is being executed
- Show 'No results' when there are none
- Increases rowsMax for TextField
- Now only visible on Custom SQL Query view
- New magnifying glass
@benj-zen benj-zen requested a review from dingens June 15, 2020 10:15
@dingens
Copy link
Contributor

dingens commented Jun 16, 2020

lgtm! I didn't look at the source code though, I just played around with it :)

Now I just miss

(copied from slack) irgendwie bin ich nicht damit zufrieden dass man für die hauptoperation (query) dieses kleine versteckte menü anklicken muss. das ist irgendwie das gegenteil von guter ux. finden wir da nicht was besseres? vllt doch tabs und wir bemühen uns uns damit extrem kurz zu fassen (ggf zusatzinfo per mouseover) damit es immer in eine zeile passt?

(but if you don't like to change it, let's keep it that way and I'll make a suggestion some day. Now that I've learned more about react I think I can do this :) )

and

Also, I'd like to rename pqdb-frontend to just frontend (or web-frontend, maybe)

@benj-zen benj-zen force-pushed the frontend_enhancements branch from 98671cc to 1caccc6 Compare June 17, 2020 12:09
@benj-zen
Copy link
Collaborator Author

I would address your first comment in another PR, second is done.

@dingens dingens merged commit 3e6114b into master Jun 17, 2020
@taudor taudor deleted the frontend_enhancements branch June 26, 2020 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants