Skip to content
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

Flash messages layout #38

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Flash messages layout #38

wants to merge 19 commits into from

Conversation

ignaciosy
Copy link
Collaborator

@ignaciosy ignaciosy commented Jan 15, 2025

Closes #29 and is related to #15

image
Screen.Recording.2025-01-15.at.14.46.05.mov

Also defined some base css variables like colors, so we can adjust them easily in the future.

@ignaciosy ignaciosy self-assigned this Jan 15, 2025
@ignaciosy ignaciosy requested a review from a team as a code owner January 15, 2025 17:49
Copy link
Member

@simon-isler simon-isler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The flash still appears above the heading?

<span><%= msg %></span>
</div>
<% end %>
<div id='flash-container'>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div id='flash-container'>
<div class='flash-container'>

should rather be a class

background-color: rgb(from var(--error-color) r g b / 80%);
}

button.close {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
button.close {
.btn-close {

I think I'd prefer strict usage of css classes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open

@@ -84,3 +91,58 @@ table {
width: 100%;
}
}

#flash-container {
position: fixed;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we use a fixed position? I think this make the flash message still appear "above" the model heading

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it does slightly, but has some opacity so you can still read the heading, and adding too much margin-top on the heading to prevent this would look a bit off as well.

On the other hand, having it inline would cause all the context to be pushed down, which is confusing and annoying.

So I personally like how it looks now, but I can think of alternatively moving the flash to the bottom-right of the screen like this:
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good idea! I would add it at the bottom.

Still, I would be annoyed by the "updated sucessfully" flash msgs. Imagine you would have this in a google spreadsheet? If you update multiple rows, each returning a flash msg?

flash[:notice] = t("hotsheet.success", record: model.model_name.human)
flash[:success] = t("hotsheet.success", record: model.model_name.human)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we really keep the flash msg for success state? I don't think we should display it in this case

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean show no flash at all on success and only on failure? I find important having some visual feedback that your action was performed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replied in the chat above regarding this

@ignaciosy ignaciosy mentioned this pull request Jan 20, 2025
@ignaciosy ignaciosy changed the base branch from main to fix-ci-ruby-version January 20, 2025 09:41
@ignaciosy ignaciosy force-pushed the feature/flash-layout branch from 1247b96 to df62803 Compare January 20, 2025 09:42
@ignaciosy ignaciosy requested a review from a team January 22, 2025 13:36
@simon-isler simon-isler self-requested a review January 23, 2025 07:59
@@ -84,3 +91,58 @@ table {
width: 100%;
}
}

#flash-container {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still not a class?

@@ -84,3 +91,58 @@ table {
width: 100%;
}
}

#flash-container {
position: fixed;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good idea! I would add it at the bottom.

Still, I would be annoyed by the "updated sucessfully" flash msgs. Imagine you would have this in a google spreadsheet? If you update multiple rows, each returning a flash msg?

Comment on lines +103 to +104


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

background-color: rgb(from var(--error-color) r g b / 80%);
}

button.close {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open

flash[:notice] = t("hotsheet.success", record: model.model_name.human)
flash[:success] = t("hotsheet.success", record: model.model_name.human)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replied in the chat above regarding this

VERSION = "0.1.1"
VERSION = "0.1.2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's bump the version only on the main branch. not every PR/feature needs a separate release

Base automatically changed from fix-ci-ruby-version to main February 1, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The flash layout is displayed behind the sidebar
2 participants