-
Notifications
You must be signed in to change notification settings - Fork 49
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
Toolbar #36
Toolbar #36
Conversation
Grids are hard. Might need some refactoring.
The way it's done in the prototype is simply by toggling classes. I've setup 4 classes which will change the look and feel of the results. So when I click grid, first it deletes all 4 class, just to make sure none are than, than only the active one from the button is added. All elements inside a result div react to this class |
I had a look yesterday. To solve the problem we should see the toolbar as a single entity. As I understand it, the toolbar is always going to be above the content and it will only move as the windows is resized. |
Yep, that sounds good, I'll try it out. I was struggling a little bit with the CSS grid as I've never used it before so at the moment the toolbar buttons go all over the place. |
I totally forgot that content can be spread over several cells. The toolbars is the whole first row and uses flex-box now. I noticed one issue is that there is never a hotizontal scrollbar in |
When you use ID you can pin-point exacty where each div goes in the toolbar. Thats how we did it in the prototype aswell. As for the settings panel, this is indeed a div which is set to display:none. That is the same as i did the search panel and the depricated locations panel. |
PS indeed i think that drawer function looks the same. Cant jquery be used if this wont work? |
To hide a scrollbar you either use this for the content are If a scrollbar shows in other areas you can force hide it with this; |
@hummingly Im not sure i see any difference in that scrollbar track and thumb in these 2 images. In both images i see a scroll track and in both i believe i see an scroll-thumb. Isnt that the small rectangle at the top? But i guess you meant the missing horizontal one. PS i added a custom scrollbar to my mockup and it works fine. You need to set the overflow-y:scroll to the content area. Why does it need height actually? In my prototypes ive set the overflow area to initial. In order to get this to work the content area needs an extra div which i call forced-overflow. This has has these settings;
You can check my prototype v10 and also this screengrab I can also added this custom scrollbar to a select field field the tagging and also in the settings |
After comparing the images fullscreen i thing i understand what you meant. I also think by accident you typed horizontal scrollbar while meaning vertical. You mean the track height isnt correct in the first image. I still think that due overflow not set, in the second image you did add that and than it show fine. though you did need to delete the toolbar, im not sure why though. |
I opened the html file by default with Firefox which shows the default scrollbar and the arrow at the bottom is also missing. But openening in Chrome shows your custom scroll bar which is why it does not matter. Now I have set a height for the toolbar and subtract it from the height. This fixes the issue. |
Why does it need a height value to show the scrollbar? Mine works without setting any height. Because if it does need a height, than on resize you need to recalculate it otherwise it will break the scrollbar. |
Both images have overflow set. As you noted in the second image the scrollbar is correctly sized. The reason is that the height of the content area is 100vh (inherited from body), which means without toolbar it shows it correctly. But with the toolbar the total height is 100vh + height of toolbar which is greater than the viewport height (100vh). The scrollbar is moved down by the toolbar. That's why that arrow is missing. |
Setting the height in the grid is better. I haven't done anything about the behaviour of the toolbar on resize yet but that can be done later. |
@@ -73,6 +74,15 @@ class FileStore { | |||
} | |||
} | |||
|
|||
@action | |||
async loadLocation(dir: string) { | |||
await this.clearFileList(); |
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.
Why is there an await
? clearFileList
is unlike removeFile
not marked as async.
@@ -73,6 +74,15 @@ class FileStore { | |||
} | |||
} | |||
|
|||
@action | |||
async loadLocation(dir: string) { |
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.
Exception handling is missing which causes on my pc an exception since I moved those folders to another drive.
if (platform === 'win32') { // Windows | ||
} else if (platform === 'darwin') { // Mac | ||
} else if (platform === 'linux') { // Linix | ||
} else { |
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.
Electron only supports windows, linux and macos and there are also no plans for us to ship to other platforms right now. A switch statement would be better.
// https://www.npmjs.com/package/platform-folders | ||
if (platform === 'win32') { // Windows | ||
} else if (platform === 'darwin') { // Mac | ||
} else if (platform === 'linux') { // Linix |
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.
typo
const platform = os.platform(); | ||
const homeDir = os.homedir(); | ||
|
||
const systemDirs = { |
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.
Could be an enum
@@ -29,8 +29,9 @@ class UiStore { | |||
@observable theme: 'LIGHT' | 'DARK' = 'DARK'; | |||
|
|||
// UI | |||
@observable isOutlinerOpen: boolean = true; | |||
@observable outlinerPage: 'LOCATIONS' | 'TAGS' | 'SEARCH' = 'TAGS'; |
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.
Could be an enum
I've replaced the Locations tab with an Import tab for now as we agreed on in the meeting, so most of that code has been removed (but I agree with your comments @hummingly !) |
I'm just used to using a lot of enums and it was more meant as a suggestion. It is mostly to prevent small typos as mistyping the name of an enum variant will result in an error. If we're going to use those string literals in a lot of places, it would be better to use the auto-completion than copy and pasting. |
The cool thing about Typescript is that string literals have that behavior too, without having to import anything :D |
Is it alright to merge this PR? It would be nice to make a release before the meeting. We'd also have to merge #32 which has some conflicts with this one |
Closes #29 |
Closes #29
I tried to use the grid but it's a little more difficult than I hoped to make it act like the UI prototype.
It mostly contains placeholder elements, except for toggling the inspector+outliner (now with transitions!), the settings button and the sorting button (which only opens a menu).