-
Notifications
You must be signed in to change notification settings - Fork 52
Conversation
I fixed it in f181f2c. It was indeed a failed merge. I don't know how that happened. Luckily I could restore the correct code from an older commit. @kamil4 You already found 95% of the problems yourself in a9f5ba1.
The code that was there was completely outdated. It suddenly also used jQuery selectors again which actually was an alarm sign to me that something really, really bad had happened. The remaining bug fix is in f181f2c. It was mostly about deleting old code which had sneaked in again. It already had been correct in ef3eddc once. I hope this is the only "accident" which happened. |
@kamil4 I solved two of the three issues which you raised on Gitter at Oct 15th 2022 07:17.
|
Somehow the commit 1211769 has no effect for me; even if I delete the whole I see an undesirable change in the look in the individual photo download dialog. As you can see, the black bar on top of each button is missing. Another, more subtle change is that whereas before the buttons were subtly darker than the background, now they fully blend in. From a quick look, on |
When importing from the server, any errors (e.g., if there's an |
That is somehow expected. I noticed the same problem. You must run However, for some reason we don't commit |
7fada3e
to
e72d7a5
Compare
The different style classes are not the cause of the regression. They have been there before and still are. The regression was rather a victim of my attempt to streamline the CSS. Do you remember the guy who was whining about the CSS being too complicated to create a custom color scheme? Same is true for everything else in this CSS. Previously, there has been two different kind of settings at two different places which played together to achieve the former visual effect: .downloads .basicModal__button {
box-shadow: inset 1px 0 0 rgba(0,0,0,.2);
border-radius: 5px;
}
.basicModal__button {
border-top: 1px solid rgba(0,0,0,.2);
} The first CSS rule adds a "shadow" to the left side of the box. But as the third and fourth parameter ("blur radius" and "spread radius") are both zero, the "shadow" degenerates into something which creates the same visual effect as a left border of 1px width and a 20% transparent black. The same effect could have been achieved more explicitly (and efficiently computation wise) by When I came across the second rule I just deleted it, because frankly it doesn't make much sense to have a border around a button only at the top. This is a general problem with that whole CSS: It is a bunch of statements which are wildly scattered across several different rules but logically belong together. Even worse they depend on each other: if you change the color in one of the rules you need to remember to change to other rule, too, or the color of the border-like left shadow and the real top border won't match. It's not separation of concerns but diffusion of concerns. 😁 Anyway I fixed it in e72d7a5 but in a slightly different way than before. It is now simply: .button {
border: 1px solid rgba(0,0,0,.2);
border-radius: 5px;
} So now we have a border everywhere (top, left, bottom, right). @kamil4 Let me know if you like this one. Honestly, I would like to throw out all the
I cannot confirm that the background of the button was subtly darker than the background on .button {
border: 1px solid rgba(0,0,0,.2);
border-radius: 5px;
background-color: black(0.05);
}
Fixed in 30fe8df. |
@kamil4 fixed it in 79a9761. First, I thought a fix would make the code more complicated, but it actually removed lines of code. But instead we have a long comment now 😆 |
I'll prefix this by saying that I'm not a graphic designer so I have no inherent understanding why things are the way they are or how they should be. BUT (you knew that was coming, didn't you? 😉).
I'm in agreement with you on this, I think. I've always found it strange how many buttons in Lychee look "unfinished", with no border at all on the bottom or the right. I'm all for doing something about that. And that applies not just to the download" buttons, but also, e.g., to "Copy to clipboard" in the photo's "direct links" dialog, or to the "key" button in the login dialog:
I like that there's a border. I don't like that the buttons are completely "flat" now. That may be the current fashion, but I've actually always liked Lychee's subtle 3D look, I believe achieved with horizontal darker lines and brighter lines right next to each other. I believe on Lychee-front/styles/main/_message.scss Lines 84 to 85 in 6471e78
Your change removes not only the dark shadow on the left (as you point out, it's unnecessary) but also the light one on top.
As I said, my personal preference is to preserve the current look (i.e., not go completely "flat"). If that can be achieved without shadows, that's fine with me, but it's not immediately obvious to me how to do that.
Pretty sure; I just verified with the color picker in GIMP in my "old" image from my earlier post in this thread. I'm seeing a difference by a single shade (e.g., #414141 vs #424242), but it's there.
I'm honestly not sure about that. I think a full border serves the same purpose better. I'm for eliminating that color difference and keeping the border instead.
I would call the state of Lychee CSS consistent with the state of the rest of the front end: it is spaghetti code.
I try to avoid running HEADS-UP: I'm going to push a commit to your branch, with a few CSS changes. Tweak as you see fit:
This should take care of the dialog boxes. There are more "unfinished" buttons in Settings, Users, etc., but that's a separate problem. |
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 finished going over my notes from the code review of this PR and I'm satisfied with its state at this point (though see two notes about missing localizations that I just added).
scripts/main/upload.js
Outdated
$(".basicModal .rows .row:nth-child(n+" + (latestFileIdx + 2).toString() + ") .status") | ||
.html(lychee.locale["UPLOAD_CANCELLED"]) | ||
.addClass("warning"); | ||
const row = upload.buildReportRow("General"); |
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 believe this string should be localized?
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.
Fixed in 069b906.
scripts/main/upload.js
Outdated
topSkip += jqEventRow.outerHeight(); | ||
// The event report does not refer to a | ||
// specific directory. | ||
row = upload.buildReportRow("General"); |
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 comment regarding the localization of "General"
.
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.
Fixed in 069b906.
* Localization * Changed dependency for basicModal * Rewrote CSS * Adopted jsDoc for basic modal * Adopted create login dialog * Adopted create (regular) album dialog * Adopted create (tag) album dialog * Adopted show tags dialog * Adopted rename album dialog * Adopted set album description dialog * Adopted set album license dialog * Adopted set album soring dialog * Fix `basicModal.visible` * Adopted login and about dialog * Renamed some methods * Adopt Album Protection Policy Dialog * Make formatting * Adopted Album Sharing Dialog * Adopted QR dialog * Adopted Delete Album Dialog * Adopted Album Move/Merge Dialog * Adopted Enter Password Dialog * Adopt Import From URL Dialog * Adopt Import From Server Dialog * Adopt Upload Dialogs * Fix closing of dialogs * Adopted U2F dialog * Adopted all dialogs but those for photos * Adopted Photo Title Dialog * Adopted Photo Protection Policy Dialog * Adopted Photo Description Dialog * Adopted Photo Tag Dialog * Adopted change from dialog to content area * Adopted Photo Link Dialog * Adopted Photo QR Code Dialog * Adopted Photo Archive Dialog * Some cleanup * Fix last dialog * Fixed API token dialog * Run prettier * Update scripts/3rd-party/basicModal.js Co-authored-by: Kamil Iskra <[email protected]> * Apply suggestions from code review Co-authored-by: Kamil Iskra <[email protected]> * Fix Typo "Model" -> "Modal" * Fixed localization of sorting dialog * Remove unnecessary else-branch in initLogin * Fixed localization * Fix error dialog for failed login * Apply suggestions from code review Co-authored-by: Kamil Iskra <[email protected]> * Apply suggestion from code review. Co-authored-by: Kamil Iskra <[email protected]> * Removed unnecessaey !! * Removed jQuery leftover * Apply suggestions from code review Co-authored-by: Kamil Iskra <[email protected]> * Made difference between layouts compact and compact-inverse more explicit * Apply suggestions from code review Co-authored-by: Kamil Iskra <[email protected]> * Repair import from server (again) * Fixed typo * Switched NPM dep for basicModal to v4.0.0 * Switch to PR commit for basicModal to solve focussing problem * Fix round corners of search box * Repair button border in download dialog * Fixed mising space * Always keep the last updated element of the upload list at the end * Tweak the borders and shadows in dialog boxes * Fix localization of general error during upload Co-authored-by: Kamil Iskra <[email protected]>
This PR makes the Lychee frontend use the revised modal dialog (already merged LycheeOrg/basicModal#3), with additional bug fixes by LycheeOrg/basicModal#5.
The advantages of using the revised modal dialog are:
Proper support for text areas (Also a prerequisite for Markdown support #280).
Proper support for check boxes: Their boolean values are now also part of the return object provided by the modal dialog, no need to use inefficient query selectors like in
Lychee-front/scripts/main/album.js
Lines 826 to 833 in ab0f314
Correct values types: Strings from input fields, numbers from input fields, booleans from checkboxes, selections from - well - selections are returned with the proper JS type.
The additional achievements of this PR on top are:
Getting rid of
lychee.html
: Modal dialogs don't need the unfortunate, home-brewed escape mechanism provided bylychee.html
as inLychee-front/scripts/main/album.js
Line 382 in ab0f314
.textContent
is used after the dialog has been created to set the text inside an element which allows to use full Unicode as JS strings are UTF-16. This ensures that no non-ASCII character in any user-provided string (title, description, etc.) can trigger errors. This is also a prerequisite for Localization #318 and Consolidate localization Lychee#1494The upload dialog became more robust.
Lychee-front/scripts/main/upload.js
Lines 212 to 214 in ab0f314
row.listEntry.scrollIntoView(upload.SCROLL_OPTIONS);
which we can now do, because we work with proper DOM elements (here:listEntry
).Note,
upload.js
is still a mess with a lot of code duplication for importing photos from server and uploading via web browser. This needs to be fixed in another PR, not this one.Simplified structure of modal dialogs and simplified, more consistent CSS: (more about that below)
Structure of modal dialogs and CSS
The current way how dialogs were constructed was ways too complicated. Previously, a single checkbox with a label to the left and an indented description below was constructed like this
Note the redundant use of the class
'choice'
indiv
andspan
. The unnecessary nesting and the additionalspan
to build the icon for the checkbox. Now the same thing can be achieved viaMoreover, previously every dialog was more or less a unique specimen. I went back to the drawing board and considered all dialogs Lychee uses and tried to carve out a "common structure". The result and assumptions are documented in the CSS:
Lychee-front/styles/main/_form.scss
Lines 1 to 14 in 09ce761
Lychee-front/styles/main/_form.scss
Lines 190 to 235 in 09ce761
This new approach and the simplified HTML makes the layout of the dialogs more robust and actually allows to nest form elements with several levels of indention (in case this is every required).
Previously, the layout worked as follows:
The actual
<input>
element had been sitting between the<label>
which visualized the checkbox and the label to the right. It was invisible but contributed 14px of horizontal spacing to the gap in between the visual representation of the checkbox and its label. The description below has been responsible for its own indentation by 35px on the left to visually align with the label above. Hence, the CSS created an unspoken interdependence between the with of the visual representation of the checkbox (16px), the the width of the invisible real checkbox (14px) and a 1px border of the label which in sum "accidentally" happen to equal the 35px of indention of the description.The new approach looks like this
It has become much easier as it lifts any implicit interdependence. Now the
div
which creates the "input group" is responsible for the correct indention which applies to all elements in the input group simultaneously. Also the<input>
element is actually the input element.