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

Feature/notification reworked design #66

Conversation

erikyo
Copy link
Collaborator

@erikyo erikyo commented Mar 8, 2022

  • The design has been updated
  • Adds webpack

Folder structure:
includes/ui/notification-hub/assets - The work folder
assets/html - here you will find the notices and the sidebar html
assets/script - here for now you will find some scripts that has only the function to test the ui
assets/css/notify.scss - the WP-Notify style (this plugin css)
assets/css/wordpress.scss - The WordPress Admin style (will not be included in the future, but at the moment is needed for ui testing purpose)
img/ - actually there is the favicon (without that there is an error in console)
includes/ui/notification-hub/dist - Build folder

erikyo and others added 5 commits March 6, 2022 14:37
- to make sure that the pages are seen with gh pages I moved dist to docs
- cleanup
@jonathanbossenger jonathanbossenger self-requested a review March 8, 2022 14:40
@jonathanbossenger
Copy link
Collaborator

Thanks @erikyo I will work on reviewing it over the course of this week.

.browserslistrc Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
@jonathanbossenger
Copy link
Collaborator

@Sephsekla from my POV this looks good. If you have time to look this over, please do.

Alternatively, if you don't have time for a full review, it would be helpful to compare what you've done to this PR, and confirm that if we merge this, it compliments your work. From what I can see the folder structure is slightly different, in that you've built your work on the notification-hub directrory, and this PR builds everything in the docs directory.

I just want to make sure we've not lost anything important you included in your branch.

@jonathanbossenger
Copy link
Collaborator

@erikyo thanks for your patience here, it's been a busy few months.

So, I have a few things I'd like to see if we can get implemented into this PR, in order to make it more easily "testable" by end users.

  • Currently for the user to view this, they will need to know to navigate to /wp-content/plugins/wp-notify/docs/index.html. I understand why this is, but I'd like to make it easier for someone to install the plugin and find the designs. Would you be able to register a custom Admin menu (maybe something like WP Notify) that would direct the user to this URL instead?
  • At the moment the "Try this new feature" buttons slide open the Notifications hub. Could we rather change that so that it opens the link to this repository https://github.com/WordPress/wp-notify in a new tab?
  • The HTML title reads <title>WordPress Dashboard + &lt;%= htmlWebpackPlugin.options.title %&gt;</title> could we fix that so that instead of &lt;%= htmlWebpackPlugin.options.title %&gt; it says WP Notify?

If we could make those changes, it makes it easier to share this as an installable plugin, which users can install and test.

Let me know if you need any help with any of these items.

@erikyo
Copy link
Collaborator Author

erikyo commented May 10, 2022

All clear but I just have one small question:

Would you be able to register a custom Admin menu (maybe something like WP Notify) that would direct the user to this URL instead?

Where i have to register the custom Admin menu in the wp-notify plugin (here?). Let me know!

@jonathanbossenger
Copy link
Collaborator

@erikyo for now, I suggest we just add the admin menu procedurally to the main wp-notify.php file. This admin menu will be removed when we actually develop the notifications functionality, it's just to allow folks to install and see this in action, and hopefully generate some interest.

Copy link
Collaborator

@Sephsekla Sephsekla left a comment

Choose a reason for hiding this comment

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

Thanks for all the hard work here, this has really got things moving again!

I haven't yet tested it out, so just a general scan of the code, but I've added a few comments and suggestions. Some are really nit-picky, but I've just added things that have come to mind as I've read through.

README.md Show resolved Hide resolved
let title = document.getElementById('title').value;
let content = document.getElementById('content').value;

var div = document.createElement('div');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto this can be a const, since we're just mutating properties, rather than ever setting it again.


#wpadminbar .wp-notification.unread >:first-child:before {
top: calc(50% - #{$bullet-width * .5 });
left: #{ -24px * .5 - $bullet-width * .5 }; // 9 - left padding - border /2 + bullet/2
Copy link
Collaborator

Choose a reason for hiding this comment

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

These seem really fiddly, I'm wondering if there's a clearer way to handle the variables etc here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I honestly don't know how to solve it here, but it can be simplified with #{ (-24px - $bullet-width) * .5 }

/*
* General notifications style
*/
.wp-notification {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm conscious we have styles for the individual notifications in both this file and the hub file - not necessarily a bad thing but I do wonder if it could be slightly unclear for future maintenance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed from here all the css properties apart from colors and lettering (which are indeed shared between the two types of notifications), tell me if this is an acceptable solution for you.

@@ -0,0 +1,188 @@
const isProduction = process.env.NODE_ENV === 'production';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd maybe split this file out and import a couple of things, but that's a matter of personal preference more than anything.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

here the issue was solved because webpack is no longer used as long we don't need no more the dev server 😉... checkout at this branch where I am integrating this style (with all your suggestions)

@@ -0,0 +1,50 @@
<div class="wp-notification wp-notice-alert is-dismissible">
Copy link
Collaborator

@Sephsekla Sephsekla May 13, 2022

Choose a reason for hiding this comment

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

Given you've already got the html <include> setup for use elsewhere, what do you think about splitting these out into smaller files in a subfolder and including them? Just for the purpose of keeping things as modular as possible and easy to see what's what.

@erikyo erikyo closed this May 21, 2022
jonathanbossenger added a commit that referenced this pull request Jun 1, 2022
Feature/notification Design implementation (follow-up of #66)
@jonathanbossenger
Copy link
Collaborator

Superceeded by #67

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.

4 participants