feat: Redesign workspaces page - #1450
Conversation
The navbar was unnecessarily large before, which made the UI feel a bit bloaty from my perspective.
code-asher
left a comment
There was a problem hiding this comment.
Looks good to me so far! All the pages look great but I think something needs to be updated for the stories since they are all throwing errors.
| content: `" "`, | ||
| bottom: 0, | ||
| left: theme.spacing(3), | ||
| background: "#C16800", |
There was a problem hiding this comment.
Is there a good theme color that could go here in place of the hardcoded color? Like secondary or something maybe.
| proxy: { | ||
| "/api": { | ||
| target: "http://localhost:3000", | ||
| target: "https://dev.coder.com", |
There was a problem hiding this comment.
Should this be an environment variable or something so we can still develop locally?
The theme provider for storybook needs to be set in coder/site/.storybook/preview.js Lines 7 to 17 in dbd5b4a |
| }, | ||
| "dependencies": { | ||
| "@fontsource/fira-code": "4.5.9", | ||
| "@fontsource/ibm-plex-mono": "^4.5.9", |
There was a problem hiding this comment.
Suggestion: Can you pin this dependency to 4.5.9? You run the upgrade command to do it:
cd site
yarn upgrade @fontsource/ibm-plex-mono@4.5.9
There was a problem hiding this comment.
@vapurrmaid I notice we have yarn.lock - what's the thought process behind pinning dependencies?
There was a problem hiding this comment.
I'll answer those two questions separately:
- Why do we want them pinned
vs
- Why pin in package.json
For the former: We have a RFC and guide covering, but the TL:DR is more incremental upgrades w depend-a-bot
For the latter: I don't know if having them unpinned interferes with depend-a-bot or any other tool, but simply for precision. I shouldn't have to hunt down the actual version in yarn.lock to answer what version of X we're on.
There was a problem hiding this comment.
Thanks, will look at the guide!
| <TableCell>Name</TableCell> | ||
| <TableCell>Template</TableCell> | ||
| <TableCell>Version</TableCell> | ||
| <TableCell>Last Built</TableCell> | ||
| <TableCell>Status</TableCell> |
There was a problem hiding this comment.
Suggestion: All of these should be defined in Language, including the <Button> text above
There was a problem hiding this comment.
Where did the Language convention come from? Have we thought about using react-i18next?
There was a problem hiding this comment.
Great question!
i18n was not implemented in v1, and will be an eventual need for v2. We haven't yet planned for when but we know it will be an effort that we will eventually take on. In the meantime, Language is a simple way of using primitives to begin resourcing strings for what's next. The idea wasn't to commit to a framework or have to solve that problem, but ensure that we're organized and ready to for when we do.
As a bonus, we can share Language in test like this:
coder/site/src/pages/LoginPage/LoginPage.test.tsx
Lines 21 to 27 in 26b04cc
There was a problem hiding this comment.
Great, make sense to me! Thanks for explaining.
|
Praise I really like the Status column, it's very nice 🎨 |
|
@kylecarbs I assigned this ticket #766 to you since this work looks to be related to it. |
|
I noticed we're keeping some overrides in |
|
@Kira-Pilot those are things I added specifically in this PR to adjust some stylistic things. |
| @@ -0,0 +1,32 @@ | |||
| export const getTimeSince = (date: Date): string => { | |||
There was a problem hiding this comment.
Should we use a library for this time stuff instead? I've used moment.js and day.js in the past
There was a problem hiding this comment.
Yup, I implemented @vapurrmaid's suggestion of using day.js!
There was a problem hiding this comment.
I made this suggestion above: #1450 (comment) which is prior art from v1. I'm quite happy with dayjs from that experience, and I know it's a small library.
|
@kylecarbs I am having a hard time running this locally using |
|
Yup! The create workspace page is included in #801 |
There was a problem hiding this comment.
I like the default look of the field input labels. The dialogs looked a bit better before IMO but definitely still usable (I like the reset password dialog though).
The margins component might need a background color removed or something, right now it has white text on a gray background https://www.chromatic.com/test?appId=624de63c6aacee003aa84340&id=62828332ad84ca004a3e0e03
Very handy we can see all the different workspace states in Chromatic!
Edit: this one seemed a bit strange to me as well, is that a disabled button? https://www.chromatic.com/test?appId=624de63c6aacee003aa84340&id=62828332ad84ca004a3e0ded
Not sure if this matters but should this be white? https://www.chromatic.com/test?appId=624de63c6aacee003aa84340&id=62828332ad84ca004a3e0dfd
greyscaled
left a comment
There was a problem hiding this comment.
One quick question I thought I'd submit review for right away since it's simple.
Following up with other items shortly.
| @@ -1,20 +1,17 @@ | |||
| import CssBaseline from "@material-ui/core/CssBaseline" | |||
| import ThemeProvider from "@material-ui/styles/ThemeProvider" | |||
| import { withThemes } from "@react-theming/storybook-addon" | |||
There was a problem hiding this comment.
Question(if-minor): Are we able to remove this dependency now "@react-theming/storybook-addon": "1.1.5", ?
|
|
||
| export const Language = { | ||
| createButton: "Create Workspace", | ||
| emptyView: "so you can check out your repositories, edit your source code, and build and test your software.", |
There was a problem hiding this comment.
|
@code-asher all have been fixed! That weird button is actually a loading button, and looked weird before! |
| const Template: Story = (args) => ( | ||
| <Margins {...args}> | ||
| <div style={{ width: "100%", background: "lightgrey" }}>Here is some content that will not get too wide!</div> | ||
| <div style={{ width: "100%" }}>Here is some content that will not get too wide!</div> |
There was a problem hiding this comment.
This still needs a background color - it proves that the margins are working
There was a problem hiding this comment.
Ahh good catch! I'll make it black.
| import { WorkspacesPageView } from "./WorkspacesPageView" | ||
|
|
||
| const WorkspacesPage: React.FC = () => { | ||
| const [workspacesState] = useMachine(workspacesMachine) |
There was a problem hiding this comment.
This reminds me that now that I'm doing a bunch of polling on the workspace page, I can and should useMachine for that too.
There was a problem hiding this comment.
Oh interesting. I never thought of that, but I suppose it makes sense.
presleyp
left a comment
There was a problem hiding this comment.
Looks good, I have a couple important but small comments about the status bar and then some stylistic things you can decide on
|
Thank you for the reviews everyone 🥳🥳🥳🥳🥳 @vapurrmaid I see you're pending on UI for Storybook. I'm going to merge this in, but I'm extremely happy to make any changes post! |

As part of redesigning the workspaces page, I updated the theme to dark mode and removed overrides resolving #1449. There's a lot of work that can be done here to improve, but this is a good start!
I've checked all pages to ensure nothing is bugged/broken, and it all looks good!
A text input will be added in the future to allow for filtering. This will work similarly to GitHub's issue filters:
owner:kylecarbs,status:running,is:outdated, etc.I proposed initially that workspaces be nested under templates, but that provided a restrictive view for admins. Admins and managers should get a full view of their Coder deployment from the workspaces page, which they now can!
Todo
Maybe pagination? Might do that in another PR