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

[dashboard] Allow workspace renaming #5695

Merged
merged 2 commits into from
Sep 16, 2021
Merged

Conversation

laushinka
Copy link
Contributor

@laushinka laushinka commented Sep 14, 2021

Description

After a discussion with @corneliusludmann and @gtsiolis, instead of the initial proposal of allowing workspace ID renames, this PR allows the renaming of a workspace context description.
The reason to go this way is because the the workspaceID affects at the very least the URL of the workspace, and therefore could introduce breaking changes.

Related Issue(s)

Fixes #3946

How to test

  1. Go to list of workspaces in Dashboard.
  2. Click on the options on the far right, choose Rename.
  3. Give the workspace a different description.

Release Notes

Allows renaming of workspace description.

Screenshot 2021-09-14 at 15 00 03

Screenshot 2021-09-14 at 15 00 17

Screenshot 2021-09-14 at 15 00 24

@gtsiolis
Copy link
Contributor

gtsiolis commented Sep 15, 2021

Looking at this now! 👀

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

UX looks great overall, @laushinka! 🌟

Lunch happened and reviewing took longer than expected! 🍝

Left some comments below, but feel free to open follow up issues for anything that would significantly increase the scope of this PR. 💭

Approving to unblock merging. I'd suggest to also ask for a closer look (review) at the code. ➿

/hold

import ConfirmationModal from '../components/ConfirmationModal';
import Modal from '../components/Modal';
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: Good to see the modal component in action again! ➿

<Modal visible={isRenameModalVisible} onClose={() => setRenameModalVisible(false)} onEnter={() => { updateWorkspaceDescription(); return true }}>
<h3 className="mb-4">Rename Workspace Description</h3>
<div className="border-t border-b border-gray-200 dark:border-gray-800 -mx-6 px-6 py-4 space-y-2">
<input className="w-full" type="text" defaultValue={workspaceDescription} ref={renameInputRef} />
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: When removing the description text, could we use a placeholder to fall back to the previous description. If the initial context name is not available we could reuse the last one in place.

Using an empty string Changed description Removed description
Screenshot 2021-09-15 at 6 21 15 PM (2) Screenshot 2021-09-15 at 6 21 04 PM (2) Screenshot 2021-09-15 at 6 21 17 PM (2)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

Copy link
Contributor

@gtsiolis gtsiolis Sep 16, 2021

Choose a reason for hiding this comment

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

@laushinka Alternatively, thinking about this again, a boring (simple) solution could be to not allow empty descriptions and return a warning alert which is similar to what we do with variables.💡

Screenshot 2021-09-16 at 10 54 31 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2021-09-16 at 15 21 11

Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: Nice! What do you think of using a softer tone like the following?

Description cannot be empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes 🍦

<Modal visible={isRenameModalVisible} onClose={() => setRenameModalVisible(false)} onEnter={() => { updateWorkspaceDescription(); return true }}>
<h3 className="mb-4">Rename Workspace Description</h3>
<div className="border-t border-b border-gray-200 dark:border-gray-800 -mx-6 px-6 py-4 space-y-2">
<input className="w-full" type="text" defaultValue={workspaceDescription} ref={renameInputRef} />
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Could we enforce a character limit let's say of 250 characters as a) it does not make sense to allow more characters since these won't be visible in the dashboard and b) the generic alert dialog when saving with a long description does not provide any useful context, right?

Long description name hidden in the dashboard Long description name error
Screenshot 2021-09-15 at 7 28 59 PM Screenshot 2021-09-15 at 7 28 34 PM

components/dashboard/src/workspaces/WorkspaceEntry.tsx Outdated Show resolved Hide resolved
<Modal visible={isRenameModalVisible} onClose={() => setRenameModalVisible(false)} onEnter={() => { updateWorkspaceDescription(); return true }}>
<h3 className="mb-4">Rename Workspace Description</h3>
<div className="border-t border-b border-gray-200 dark:border-gray-800 -mx-6 px-6 py-4 space-y-2">
<input className="w-full" type="text" defaultValue={workspaceDescription} ref={renameInputRef} />
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: Long descriptions seems to bring back a similar overflow issue as in #4556.

Overflowing text when deleting a workspace
Screenshot 2021-09-15 at 7 36 55 PM (2)

Copy link
Contributor Author

@laushinka laushinka Sep 16, 2021

Choose a reason for hiding this comment

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

We should truncate it in addition to the 250 limit I suppose?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd vote for truncation to also avoid breaking this component!

On the other side, we could go all-in by a) wrapping the text, b) allowing longer description to surface on the dashboard, etc. but this would be against the notion of ephemeral environments. Maybe this is something to consider in future if needed. 🗳️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed a solution to show an error message and also truncating it. Let me know of a better error message! I'm off tomorrow, so feel free to change it here as well if I don't see the follow-up comment today.
Screenshot 2021-09-16 at 15 19 18

components/dashboard/src/workspaces/WorkspaceEntry.tsx Outdated Show resolved Hide resolved
components/dashboard/src/workspaces/WorkspaceEntry.tsx Outdated Show resolved Hide resolved
@@ -96,7 +128,7 @@ export function WorkspaceEntry({ desc, model, isAdmin, stopWorkspace }: Props) {
</Tooltip>
</ItemField>
<ItemField className="w-4/12 flex flex-col">
<div className="text-gray-500 dark:text-gray-400 overflow-ellipsis truncate">{ws.description}</div>
<div className="text-gray-500 dark:text-gray-400 overflow-ellipsis truncate">{workspaceDescription}</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: Thinking of this PR and since this was a feature requested from some community members would it be interesting to measure how much people use this feature? Maybe have a self-serve graph of how many of the existing workspaces are renamed per day or week? Maybe also how many times people clicked the rename option in the dropdown option? It could be interesting to also see if the usage of this feature decreases after #3594. What do you think? Feel free to drop the idea if this would increase the scope of these changes. 💭

Cc @jakobhero

Copy link
Contributor

Choose a reason for hiding this comment

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

fyi: Discussed this briefly with @svenefftinge earlier in the product sync meeting and we decided that adding tracking events here is a low priority given that the renaming functionality will be hidden behind the more actions dropdown. Up to you @laushinka and @jakobhero to decide if it's worth adding any tracking events within the scope of this PR. 🏓

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree that it would be useful to keep track but that we could do it in a separate issue if @jakobhero also thinks it's worth to track 🙏🏽

Copy link
Contributor

Choose a reason for hiding this comment

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

hey there!👋 all clicks on buttons, anchors or clickable divs in the dashboard will be automatically tracked with the project & teams tracking PR i am currently working on. this means that we will see how many people clicked on the rename button, but now how many renames were successfully performed (which probably would be best tracked on the server). i think having visibility on how many users clicked on the button to open the modal is a good start to see how important this is to users and sufficient for now, wdyt?

@laushinka laushinka force-pushed the laushinka/rename-workspace-3946 branch from 2b9152c to 7f3b634 Compare September 16, 2021 10:25
@laushinka laushinka force-pushed the laushinka/rename-workspace-3946 branch from 0a2baf8 to e53e486 Compare September 16, 2021 14:06
@laushinka
Copy link
Contributor Author

/unhold

@gtsiolis @corneliusludmann @JanKoehnlein just an fyi that I'll be off tomorrow.

@JanKoehnlein
Copy link
Contributor

/lgtm

1 similar comment
@JanKoehnlein
Copy link
Contributor

/lgtm

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gtsiolis, JanKoehnlein

Associated issue: #3946

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit d1a0264 into main Sep 16, 2021
@roboquat roboquat deleted the laushinka/rename-workspace-3946 branch September 16, 2021 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bring back 'rename workspace' feature
5 participants