-
Notifications
You must be signed in to change notification settings - Fork 176
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
feat: change workspace names to icons #1240
Conversation
@orgrimarr - is there a reason for this to be in "Draft" mode still? |
add9773
to
722fb80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great initiative! Please continue with this, I will close my draft PR
|
Hi, Thanks for your fast review, 😀 The goal was not to create a competing implementation, I just thought is was an easy way to share code. Sorry for that 😕 |
Some questions 😀 : In order allow both visual, should I add an option in the sidebar setting like "Use workspace drawer icon style" ? How can I persist theses settings ? (icon path, drawer visual) ? I'm only using Ferdium without an account. I wonder how to sync the icon setting. Because if we use a local path, the image might not exist in another host, and the OS path system might be different. Should we store the image content ? (We can ask for a specific image format and size like Rambox to reduce the size to a acceptable one) |
Add this user preference in the workspace preference screen. I would also move the icon text box outside of the "create" action, and into the screen where the services are associated with a workspace.
The service and similarly the workspace preferences are ultimately stored in a sqlite db - whether its using the "accountless" option (which is basically running a local server), or the hosted server solution. The internal servers' code changes are in the same repo, but the hosted server is in a sibling repo called ferdium-server. I can help review/point you to the code file where the DML needs to be changed to add a new column in that corresponding table. |
722fb80
to
cccd509
Compare
It should work as discussed. Just missing the workspace iconUrl persistance. |
@@ -53,12 +53,21 @@ const styles = (theme: { workspaces: { drawer: { width: any } } }) => ({ | |||
// width: `calc(100% + ${theme.workspaces.drawer.width}px)`, | |||
width: '100%', | |||
transition, | |||
}, | |||
appContentTransformTextWorkspace: { | |||
transform() { | |||
return workspaceStore.isWorkspaceDrawerOpen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to move the ternary to be evaluated inside the translateX()
like so?
return 'translateX(`workspaceStore.isWorkspaceDrawerOpen ? 0 : -75px`)');
(Syntax might be incorrect since I'm not typing inside an editor)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we can do that
transform() { | ||
return workspaceStore.isWorkspaceDrawerOpen | ||
? 'translateX(0)' | ||
: `translateX(-${theme.workspaces.drawer.width}px)`; | ||
}, | ||
}, | ||
appContentTransformIconWorkspace: { | ||
transform() { | ||
return workspaceStore.isWorkspaceDrawerOpen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that it is more readable.
If it's ok for you, I can push that change
appContentTransformTextWorkspace: {
transform() {
return `translateX(${
workspaceStore.isWorkspaceDrawerOpen
? '0'
: `-${theme.workspaces.drawer.width}px`
})`;
},
},
appContentTransformIconWorkspace: {
transform() {
return `translateX(${
workspaceStore.isWorkspaceDrawerOpen ? '0' : `-75px`
})`;
},
},
@@ -259,6 +259,10 @@ const messages = defineMessages({ | |||
id: 'settings.app.form.alwaysShowWorkspaces', | |||
defaultMessage: 'Always show workspace drawer', | |||
}, | |||
useWorkspaceDrawerIconStyle: { | |||
id: 'settings.app.form.useWorkspaceDrawerIconStyle', | |||
defaultMessage: 'Use workspace drawer icon style', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I was suggesting to have the user choose whether they want the name or the first character of the workspace name AND/OR the icon. Could the feature be imagined like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly.
The letter is currently a fallback for workspaces that don't have an icon.
The setting should be a select with theses choices :
- text (current display)
- (letter OR icon) AND text
- letter AND icon (if icon configured)
- letter OR icon (current PR)
It means, 3 different workspace drawer sizes
- the current (300px by default)
- icon OR letter only (35 - 75px)
- letter + icon (let's say 75 - 150px)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the workspace drawer bar be the same size of the service bar ?
I means use the serviceRibbonWidth parameter for both workspace and service bar (only when displaying icon)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vraravam Can you confirm that I have understood correctly ?
If yes, I will start the dev this week 😀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to complicate so much. only 2 options that i was suggesting:
- workspace name (current)
- icon or first character of workspace name (if the user wants to use a smaller-width option for the workspace drawer)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To permanently save this field you would probably need to sync with the server (internal and external) if I'm correct.
I'm not recalling if the server is saving workspace data as a plain JSON or not (only by checking the endpoint we can be sure of that). If that is not the case, you would need to touch both the server and the internal-server... but with the ongoing Adonis update this could be a hassle :/ I can help on that tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can we make this option the default one? I like this new look (even though I'm not using workspaces).
Great work!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you will need to sync to the internal and external servers. The db schema is the same across both - and there's a table called workspaces
to store this info.
As seen in the above pic (taken from my internal server), you can either add a new column for the useIcon
or you can add it into the data
column which holds JSONB datatype. (I personally prefer option 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you will need to sync to the internal and external servers. The db schema is the same across both - and there's a table called
workspaces
to store this info.As seen in the above pic (taken from my internal server), you can either add a new column for the
useIcon
or you can add it into thedata
column which holds JSONB datatype. (I personally prefer option 1.
Even though I would prefer option 1 (just like you) I would advise into adding it to "data" column (but first lets be sure what type of data is being retrieved there) so that it doesn't make the migration to the new Adonis's even more complicated (as we would to update both the code in the current ferdium-server, internal server and on the current adonis update PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suggested, i added the iconUrl field in data
WIP related PR on the server : ferdium/ferdium-server#102
cccd509
to
a9fd34f
Compare
a9fd34f
to
e901ed6
Compare
e901ed6
to
f84e89f
Compare
Hi @orgrimarr I've been testing your code and it seems that it breaks functionality if you use an horizontal bar and not a vertical one. Can you please fix that? Also, I've take a look at how we update workspaces and, indeed, we are going to need to touch both the internal server and Ferdium server after all (no escape from that). So there is that... I can help you with that tho! |
Thanks you both for your comments ! |
375d246
to
7106504
Compare
7106504
to
9bb75ac
Compare
@orgrimarr - is this PR mergeable at least for the internal server bits which live in this codebase itself? Can you please help to take this to completion? |
Thanks for the confirmation @orgrimarr @SpecialAro - we currently support 4 server backends:
This change is going to break for the first 2 anyways. The 3rd one, while under our control, still has a ways to go. With this being the case, how shall we proceed? |
yes - I would prefer this option as opposed to uploading an icon. For the rare cases where folks create and use custom icons, they can self-host in some website, and provide that url. In most cases though, icons are usually available on the net and so a url is easier for us to keep track of/maintain that a binary file. This will also reduce the burden on syncing between the different server backends. @orgrimarr - could you please make such a change within this same PR? |
9bb75ac
to
af26759
Compare
@vraravam I think no changes are required. Currently, we can only configure strings https://github.com/ferdium/ferdium-app/pull/1240/files#diff-e8933cda65f8319a0a3982de972254fd0ef8f96dac31e0530660e5608682ef3bR10
This property is used to configure the image src https://github.com/ferdium/ferdium-app/pull/1240/files#diff-46ab6517cb2faf44c8255f0b1a0955a5b534eaa2786fc1f1fbbe97e85d16942cR51 |
The first two (I think the 2nd one we are not supporting anymore) are going to break regardless - and users are aware of this (a message pops-up when they change to the first two. But, given that we are referring to the same project (Ferdium) I have the opinion that we should make this feature work across our entire ecosystem (account and accountless). In fact, if this works for the internal server (which still lacks the adonis update) then it should work for ferdium server, given that the implementation is rather similar (almost copy paste on the code). |
@vraravam @SpecialAro Regarding the url persistance within the Workspace table. Now that the adonis migration is done, should i keep saving the url in the data column ? or create a new one ? I can try to modify ferdium-server this week |
Keeping the same schema will hopefully keep us backward compatible with all the currently-supported servers (franz, ferdi, ferdium hosted, no-server). So I would not change that db schema at this point. |
yes, the datatype in the codebase is a string - but, at the UI level, I think its expects a file to be dragged and dropped. How will the end user experience be if they want or are forced to use a url? |
At the UI level it look like this Maybe i can iprove the placeholder with something like "Icon url" or "Icon url or local path" |
yes, a more explicit text would be very much appreciated. Sorry, I was confusing with the service icon, then realized you are referring to the workspace icon. |
777ad0a
to
d5794b3
Compare
@orgrimarr - could you please resolve the conflicts? @orgrimarr / @SpecialAro : is this PR ready to be merged (once the above is done)? |
Closing due to inactivity. Its been 1 year since the PR was opened, and no response from the OP. |
Hi @vraravam this PR is ready for merge. (Just need to rebase and fix conflicts as you asked) There were some discussion on the server / database side regarding backward compatibility : ferdium/ferdium-server#102 |
please rebase, and then we can reopen the PR. |
Pre-flight Checklist
Please ensure you've completed all of the following.
Description of Change
The icon field is not persisted, I dit not manage to do it.
The icon config could be more user-friendly than a simple text input
Motivation and Context
This PR is a proposal regarding this issue #139
Screenshots
Checklist
pnpm prepare-code
)pnpm test
passesRelease Notes