-
Notifications
You must be signed in to change notification settings - Fork 7
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
Up button revamp #82
Up button revamp #82
Conversation
Would the |
Thanks for the PR! I like the idea of having the option to include the name of the parent directory. I would wrap it in a span with a class name so that custom CSS can hide it again though, just keeping options open for the user :) Let me think about this for a bit and then I'll make a suggestion for something in between this and what we had before |
I'm no HTML5 / CSS expert, could you do something with data attributes like:- <a id="parent-dir" data-parent-folder="${dirParent(path)}" href="${pathToURL(pdirname(path))}" /> And then the user in CSS could go something like:- a#parent-dir { content: "🠈 "attr(data-parent-folder) ; } |
This makes you more of a CSS/HTML5 expert than me, lol. I didn't know about this, looks very cool! |
Yeah it didn't work when i tried it tho lol. |
Ok it actually does work, but I noticed there are 3 Solutions would be remove the extra 2 This otherwise solves the the issue of letting the default style be exactly as it was while also letting custom css do its magic. Let me know your thoughts. EDIT: Oh and yeah, solution 3: use a EDIT2: Ignore all this, all sorted, the dynamic TypeScript section really didn't like me using a self-closing |
4111769
to
0873547
Compare
Ok so here is what I have... For the default style sheet, nothing layout wise has changes except by default the opacity is now 30%. You can set this back to zero in your custom css As seen below that is just barely visible on the dark theme and we can tweak this over time of course and per theme with the With cursor hovering over, opacity is 100% as before... AND then, with just a little bit of custom css you can do this... a#parent-dir {
position: static;
background-color: transparent;
opacity: 1;
}
a#parent-dir::after {
content: "🠄 "attr(data-parent-folder);
} Let me know what you think. |
Also let me know if you need me to change any of those commit messages or move that helper function to utils etc. |
Nice, thanks! Looks cool on first sight! I'll try and check it out tomorrow. Until then it would be great if you could rebase onto main (we just merged another PR) and edit your second commit message to be "conventional" as well, e.g. |
0873547
to
4d876ea
Compare
Hey mate, I've made those changes but i haven't been able to test it properly yet. When all your changes came down something happened to my Edit: Also wasn't sure what your naming convention is for functions and what not. Most look like a simple |
…ut options This will allow you to align with the body-content section and help contain any custom css the user tries to inject using the ::before and ::after pseudo element selectors Example custom css:- div#parent-dir-content { max-width: 900px; margin: auto; text-align: right; } a#parent-dir { position: static; background-color: transparent; opacity: 1; } a#parent-dir::after { content: "🠄 "attr(data-parent-folder); }
Yeah UI design is clearly not my thing. I do think we'll need to wrap the back link in a div or something, to contain it and enable more layout options. Then you can setup your max-width to match the body-content etc. something like:- div#parent-dir-content {
max-width: 900px;
margin: auto;
text-align: right;
}
a#parent-dir {
position: static;
background-color: transparent;
display: static;
opacity: 1;
}
a#parent-dir::after {
content: "🠄 "attr(data-parent-folder);
} |
Oh, sorry about that! Were you able to resolve this? Maybe it's just running just
We don't have anything super fixed, what you say sounds good! Do you think this is something we should define, e.g. in the contribution guide? |
By the way I think this First thought that comes to my mind would be opening a pinned "customization" discussion or something where people can share stuff they did to/with their Vivify. And then linking to it from the README. What do you think? |
Yeah I figured it out pretty quick, I needed to bring down your new dependencies and something just got stuck. A reboot sorted it out though.
No I don't think so at this stage. No one wants to read 20 pages of rules before they can look at the code. Once the code grows at bit there will be more examples to look at.
So I've been thinking about this, I'm actually leaning towards your original idea and just putting the back icon and text into separate spans and calling it a day. Then users can just toggle them on or off in CSS making the 90% of use cases a lot more discoverable. Those in the know can still use ::before and ::after to insert a custom icon if they want to, and maybe we document that. I'd like to avoid the trap of over complicating things with extra customization options that no one really uses as each one comes with an additional maintenance overhead (I'm looking at you KDE devs). Maybe we could include an example or two custom css files somewhere for people to look at? |
Oh also, could you let me know which back button style you were wanting to use for the default. I assumed it was the current fixed position button in the corner. I have an uncommitted change here that cleans up the look a little bit for it (see below). Or I could set the default to my text based version that is aligned with the body text at the top of the page. Could you let me know which one you want? Or the text based (you've seen before) there is still some tightening up of the layout to be done here but you get the general idea) |
I think the more sensible default is to have the text displayed. But I think I would prefer having it all the way on the left like the button we had before instead of aligned with the document. Since it will then always be visible let's also hide the button if we're already at the root directory. By the way, I like this arrow that you have in your example but what kind of character is it? If it's this one |
Ok, I will have to lock in some space for it and will need to tidy up how the wrapping looks, otherwise it overlaps on to the body text when there are longer directory names on smaller monitors.
Can do, I was limiting my changes to the CSS, but I'm happy to do it.
I just picked one at random that looked nice, its this one from the unicode specification but its way down the list. Specifically the Unicode 7.0 spec from 2014. I'll look for a more compatible one. I assume there is no rush for this on your end? I'd like to just poke at it now for a couple days after work and stuff... |
True, I didn't consider this. Then I guess let's just do what you had in the screenshot ^^ Might look weird otherwise.
Yeah, weird, I don't know why Apple doesn't like that one haha. If I search for "leftwards arrow" everything from
No rush at all, take your time! We will hopefully release version 0.2.0 soon but if this isn't finished by then we can just do 0.2.1 :) |
I see the Maybe that depends on your font? |
Yeah it'll be a font thing, unicode has got so big and complicated with so many code points font makers can't make them all. I'll probably make a little .svg to put there. 😅 |
On Linux I've usually fixed problems like this by installing fonts that cover a wide range of unicode/emoji that act as fallback fonts Specifically Noto, Noto CJK and Noto Emoji |
Yes, probably. I think on macOS I can't pick a system font lol. But it's for the better; if I used Linux I would never leave the house again because the only thing I would do is customize my computer hahahaha it's already bad enough even with the restrictions I have on macOS
I like the dedication! haha |
Can confirm not leaving the house for that reason but also shocked that you can't change the font 😄 |
d24df1b
to
34bad15
Compare
34bad15
to
1f19f5a
Compare
Ok there is enough here now for anyone who wants to have a look. Note that I haven't removed the old button yet, will do that before merge. This is the wrapping behaviour, it now wraps on contact with the link (plus a small margin) instead of the edge of the content div, otherwise it is the same. This is enabled for markdown, notebooks, and text rendering. And this is the directory listing It doesn't have a custom icon yet. @jannis-baum we talked about swapping these out for some .svg icons. With your permission, I'd like to work on that next as its own issue? Its a huge boon to my motivation to get smaller chunks completed / merged more often. Not being a web dev guy, everything takes way longer than it should. I probably spend equal time fixing my tooling and pacing around my office as I do actually contributing to the issue haha. Oh and btw, can you both let me know if you can render this character in your browsers? --> ◂ |
@jannis-baum Oh, and please let me know what javascript/typescript sins I have made :) |
Hello! This looks really good on your screenshots! I like the up button for directories as it is but I think the one for files only works well when the first thing on the file is a headline. If I start a Markdown file with a paragraph it's a bit off ![]() and for a Notebook starting in a code cell as well ![]() Maybe we could put it above the content as you had it at some point? What do you think?
Yes, definitely! 100% with you on this. Feel free to work on #102 next if you want :)
Haha yes, I get this, I usually also try to only touch web development with a 3m pole while closing my eyes hahaha, for Vivify it just seemed like the sensible thing to do😂
Works for me!
I'll have a look at the code later😁 |
Yeah I noticed that on one of my notes (markdown notes) that didn't have a header. I don't have a plan how fix that yet, will need to think about it. The other bug, and you should test this on your browser, is on .ipynb notebooks the link isn't clickable, seems like something is covering it? If you unfloat it it becomes clickable...... |
Oki no worries. I also liked your original idea of putting it above the start of the content. You don't like that one anymore?
Ah, yes, I hadn't tried that. It's probably because of the |
Ok lets just to that, thats easy. Do you like left or right better? putting it down in the header is difficult because thats rendered by the external library, and then as you noticed, you are not always guaranteed to even have a header. I guess you could do some javascript to detect if the first line was a header or not and then position accordingly, but for now, i'm happy with this... |
Sounds good! I'd say left. I think that's the more conventional location where people would expect an up/back button |
Yes this renders for me SVG icons should be good and straight forward right now, if we have agreed on the Octicons and maybe color them like GitHub does. Once again, what dark theme colors...? 😄 |
Let's discuss in #102! |
Just playing few games with some friends at the moment, in about 30 mins I'll go de-float this 😊 |
Ok nav is back at top, defaults to the left. I'm weird, kinda like it on the right, so I wrapped it in a Also have removed the old / original button. |
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.
Looks good. Just that small thing but afterwards we can merge :)
Good work! Thank you! |
Sorry to bother after merge but gonna give an opinion on this:
The benefit of it is that the But what I would do instead is make the directory icon clickable as part of the link (which isn't currently) |
Hahaha yes a bit.
This sounds good! Maybe we do it in the context of #102? Or do you think it's more urgent and should happen ASAP? If so feel free to open a PR and patch it ^^ |
Yeah with #102 is totally fine! |
You summed it up quite perfectly. I never actually said it, but that was my plan. |
Close #81
Hey mate,
Not sure if you want it, but I've set mine up like this. I mean we can always make it more pretty later right?