-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add top banner #2381
base: master
Are you sure you want to change the base?
Add top banner #2381
Conversation
--banner-background-color-warning: #daad1b; | ||
--banner-background-color-success: #67da1b; | ||
--banner-background-color-plain: var(--more-accented-background-color); | ||
--banner-color: var(--main-text-color); |
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 don't think it's needed to have this themable since it's for exceptional cases only and user shouldn't see it often.
src/public/stylesheets/style.css
Outdated
@@ -55,10 +55,6 @@ table td, table th { | |||
background-color: var(--modal-backdrop-color) !important; | |||
} | |||
|
|||
.component { | |||
contain: size; | |||
} |
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.
This PR shouldn't be changing such fundamental classes.
@@ -10,4 +10,10 @@ export default class FlexContainer extends Container { | |||
|
|||
this.attrs.style = `display: flex; flex-direction: ${direction};`; | |||
} | |||
|
|||
withFullSize() { | |||
this.attrs.style += `width: 100%; height: 100%;`; |
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.
This does not look correct.
The root container is already 100% height, banner has certain fixed height and then the rest (the main app) should be filled with flex-grow (filling()
method)
Alternatively, wouldn't it be better to have this floating with absolute coordinates above (in the z-index sense) the main content? Since with your approach the main app will jump up and down as connection is lost/renewed.
In such case bootstrap toasts might be used as an existing solution.
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.
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.
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.
That's intrusive. You can't see the full title anymoe and some buttons are harder to reach. If you're on a plane, editing your notes with only partial internet, this would drive you crazy since you wouldn't be able to do your workflow properly.
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.
When you're on a plane and don't have internet, basically no functionality will work correctly. You should in fact stop editing until you have an internet connection, otherwise you risk data loss.
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.
Wait - just for clarification. Does Trilium Notes save the progress offline and then uploads it once it has a connection back?
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.
Web version - no, it has no offline storage.
Desktop version works fully offline and then synchronizes with the server periodically.
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.
Okay in that case your solution would fit as well for the web version (only). However, we should probably change the location to the top right (or something less intrusive).
this.$timer = this.$widget.find(".timer"); | ||
|
||
this.$widget.on("mouseenter", this.pauseTimer.bind(this)); | ||
this.$widget.on("mouseleave", this.resumeTimer.bind(this)); |
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.
Can you clarify what's going on here?
In my mind it's really simple - (non-pausable) timer, when it detects that the network is down it will show the banner, once it's up again, banner disappears. But here I see info, warning, success, plain, what is all that for?
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.
In case we want to show other notifications, they should be pauseable
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 be honest I don't understand what "pausable notification" is, but in general YAGNI principle applies here.
@Myzel394 I do really think to have a place for showing the connect status and sync status for WEB version is a great idea. |
closes #2366
This is not the full PR yet. @zadam what do you think so far? If you are ok with this approach so far, I will add the internet-lost-message.