Skip to content

New theme for web UI#957

Merged
rdmark merged 27 commits intoPiSCSI:developfrom
nucleogenic:webui-modern-theme
Nov 14, 2022
Merged

New theme for web UI#957
rdmark merged 27 commits intoPiSCSI:developfrom
nucleogenic:webui-modern-theme

Conversation

@nucleogenic
Copy link
Copy Markdown
Member

@nucleogenic nucleogenic commented Nov 2, 2022

Introduction

This change set contains a concept for a "modern" web UI theme.

It provides an interim solution to the New Web UI roadmap item, which is a high effort feature and currently on hold.

Goals

  • Improve UX and aesthetics on modern browsers
  • No loss of legacy browser compatibility when using the 'classic' theme
  • Minimal changes to existing templates (changes must be theme-agnostic)
  • No additional steps in the build process, e.g. npm build process
  • Responsive layout for mobile/tablet

Browser Support

The modern theme is selected as the default for the following browsers:

  • Safari >= 14 (i.e. Big Sur)
  • Chrome >= 100 (includes Brave, Vivaldi, etc)
  • Firefox >= 100
  • Edge >= 100
  • Mobile Safari >= 14
  • Chrome Mobile >= 100

All other browsers and browser versions will be given the classic theme, although it is still possible to switch manually.

Changes

  • Assets located in static/themes/{theme}
  • Updates to templates to improve ability to style with CSS, e.g. adding classes, wrappers
  • Added a new theme called "modern"
  • Restyled Dropzone uploader from scratch
  • Added a new endpoint to change theme
  • Added link in footer to switch between the two themes
  • Added browser_supports_modern_themes() function
  • Added auto-selection of modern theme for supported browsers
  • Added Prettier and Stylelint rules
  • [Updates to Docker dev environment]

Preview

Screenshot 2022-11-02 at 00 11 51

Try It Out

1. Build and launch Docker containers:

git clone https://github.com/nucleogenic/RASCSI.git --branch webui-modern-theme
cd RASCSI/docker
docker compose build --no-cache
docker compose up

2. Access web UI:

Todo

  • Check compatibility across desktop browsers
  • Check compatibility on mobile devices
  • Auto-detect whether to offer classic or modern theme
  • Better theme names?

Credits

  • @rdmark for the many improvements to the web UI template markup over the last few months, and suggesting the user-agents/ua-parser library
  • Andy in #rascsi-dev for the template feedback

@rdmark
Copy link
Copy Markdown
Member

rdmark commented Nov 2, 2022

A very elegant approach to reskin the web app, indeed! I'm impressed. The monochrome icons are stylish, and the on hover rainbow effect on the RaSCSI Reloaded text in the header is a nice touch.

My only nitpick layout wise is that having the load configs form on the far left and the save configs form on the far right. I didn't immediately notice the other when looking at either of them. Perhaps centering is better? Or on top of each other as before? Something to iterate on I think.

BTW what do you mean by dropzone.js being uploaded from scratch? I didn't immediately see a code change that corresponded to that.

Left a few nitpick comments for your consideration.

@rdmark
Copy link
Copy Markdown
Member

rdmark commented Nov 2, 2022

BTW it might be fun to brainstorm more memorable names for the themes than classic and modern. ;)

@nucleogenic nucleogenic force-pushed the webui-modern-theme branch 2 times, most recently from 77af2d0 to 6ca4ef0 Compare November 3, 2022 21:42
@nucleogenic
Copy link
Copy Markdown
Member Author

BTW what do you mean by dropzone.js being uploaded from scratch? I didn't immediately see a code change that corresponded to that.

Oops, I meant to say I've restyled the Dropzone upload-er!

My only nitpick layout wise is that having the load configs form on the far left and the save configs form on the far right. I didn't immediately notice the other when looking at either of them. Perhaps centering is better? Or on top of each other as before? Something to iterate on I think.

That's a fair observation. The rationale was that the most important UI element (IMO) is the table of active devices, so I wanted to visual noise and unused space above it.

We received a comment in #rascsi-dev which critiqued the new theme as having too much vertical padding/whitespace, causing the active devices table not to fit on a 800px depth viewport, so I am hesitant to immediately return these to the stacked layout.

One option - out of scope for this PR - would be to consolidate the two forms; for example, we could start with an empty default.json file (auto-created if missing), then add a 'Save As' button which prompts for the filename.

Example:

image

@rdmark
Copy link
Copy Markdown
Member

rdmark commented Nov 4, 2022

Well noted on the conservation of vertical space as a design choice. I like the proposed new unified config management form. We can definitely experiment with that in future PRs.

@nucleogenic nucleogenic changed the title [PREVIEW] New theme for web UI New theme for web UI Nov 8, 2022
@nucleogenic nucleogenic marked this pull request as ready for review November 8, 2022 14:22
Copy link
Copy Markdown
Member

@akuker akuker left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I'm not an expert on this code. I'd like @rdmark to review/approve this PR if he has time.

@akuker
Copy link
Copy Markdown
Member

akuker commented Nov 10, 2022

Note: I'm assuming the failed unit tests are because the nucleogenic fork doesn't have the saved SonarCloud credentials. If this still fails once we merge to develop, I can help figure out what's going on.

Copy link
Copy Markdown
Member

@rdmark rdmark left a comment

Choose a reason for hiding this comment

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

Looks good overall -- just a few nitpick comments inline.

The main question that I have is the inclusion of the large CSS style file with an MIT license. I assume MIT and BSD are compatible but INAL.

Also, are you the author of the SVG icon graphics? And if not, who's the author and under which license are they distributed?

Apart from this I have no concerns about the code changes! Amazing job!

TEMPLATE_THEMES = ["classic", "modern"]

# Default theme for modern browsers
TEMPLATE_THEME_DEFAULT = "modern"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about calling this theme something like "rainbow" to allude to the nice text color effect when hovering over "RaSCSI Reloaded" in the title bar at the top.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The text effect is a gradient made up from the colours inside the raspberry in the RaSCSI logo. I thought it was neat as a subtle 'flourish' (although I can totally see this getting old and us removing it before too long). The theme is otherwise quite formal, IMO. It is comparatively modern, but not what most would consider contemporary.

I think "rainbow" is clever (for those that make the connection), but it's somewhat equivocal, and might therefore be confusing for those that have 🌈 (colourful, vibrant) in their mind?

image

I don't have any other suggestions at the moment! ☹️

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One idea is html5 -- this term is almost retro at this point. :)

@nucleogenic
Copy link
Copy Markdown
Member Author

nucleogenic commented Nov 11, 2022

@rdmark

Regarding licences:

  • Icons are from an icon set called Feather. I thought the licence was referenced in the SVG source, but it's actually not, so we need to distribute the copyright attribution and MIT licence with them. I propose we do this by including the original licence file (here) in python/web/src/static/themes/modern/icons/LICENSE.

  • Bootstrap Reboot has the MIT license and the file python/web/src/static/themes/modern/bootstrap-reboot.css includes the original licence header. (edit: Moved to CDN.)

@akuker
Copy link
Copy Markdown
Member

akuker commented Nov 11, 2022

The main question that I have is the inclusion of the large CSS style file with an MIT license. I assume MIT and BSD are compatible but INAL.

Its my understanding that BSD and MIT are compatible as well. It might be worth adding a note at the bottom of LICENSE in the root directory to state that some components are MIT licensed.

(Note: The Banana Pi code that I'm pulling it is also MIT licensed, so this concern is not unique to the web UI)

@rdmark
Copy link
Copy Markdown
Member

rdmark commented Nov 12, 2022

@nucleogenic I found one i18n bug when playing around with this. The fixed width of the form buttons in the attached device action column lead to some localized strings being truncated. Affects German/Spanish/Swedish currently.

Can we go back to dynamic widths on those buttons again? We never know how long strings future localizations might bring to the table!

i18nbug

@rdmark
Copy link
Copy Markdown
Member

rdmark commented Nov 12, 2022

Another minor visual bug: When LUNs are in use, the device icon shows up in the LUN column.

lunbug

@rdmark
Copy link
Copy Markdown
Member

rdmark commented Nov 13, 2022

@nucleogenic Anything left on your todo list now? The "boring" theme naming may be for the best. They make it very clear what they are.

It'd be great to get this merged to open up for continuous iteration on the Web UI code!

@nucleogenic
Copy link
Copy Markdown
Member Author

@rdmark I don't think there are any further changes I want to make at this point, so fine to get this merged into develop.

@rdmark rdmark merged commit 3627b39 into PiSCSI:develop Nov 14, 2022
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.

3 participants