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

Favourite tab added in the sidebar #6553

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

Conversation

TechSubham
Copy link
Member

@TechSubham TechSubham commented Dec 22, 2024

  • [ ✅] I signed and returned the Plone Contributor Agreement, and received and accepted an invitation to join a team in the Plone GitHub organization.
  • [✅ ] I verified there aren't other open pull requests for the same change.
  • [ ✅] I followed the guidelines in Contributing to Volto.
  • [ ✅] I succesfully ran code linting checks on my changes locally.
  • [ ✅] I succesfully ran unit tests on my changes locally.
  • [ ✅] I succesfully ran acceptance tests on my changes locally.
  • If needed, I added new tests for my changes.
  • If needed, I added documentation for my changes, either in the Storybook or narrative documentation.
  • [✅ ] I included a change log entry in my commits.
Screen.Recording.2024-12-23.at.2.20.05.AM.mov

Copy link

netlify bot commented Dec 22, 2024

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit 57b2bc2
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/6778fdd71902b8000875f575

@TechSubham
Copy link
Member Author

All checks have passed successfully and the code is ready for review. I've completed the requested changes. Requesting a review and merge from someone with write access since I don't have merge permissions. Thanks!

@stevepiercy
Copy link
Collaborator

@TechSubham is this a feature enhancement per #2039? If so, I think @tisto would be interested in this feature, and you should amend the Description of the PR with "Closes #2039".

Copy link
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

The default language is en-US. Please change the spelling of all instances of "Favourite" to "Favorite".

Also remove *.crdownload files.

Also we have icons available that you should use in Pastanaga, instead of adding new ones. See https://6.docs.plone.org/volto/contributing/icons.html for usage.

@TechSubham
Copy link
Member Author

I’ve made the requested changes to the branch:

Updated all instances of "Favourite" to "Favorite" to align with en-US language standards.
Removed all .crdownload files.

Please let me know if there are any further adjustments or if this branch is ready for review.

@stevepiercy stevepiercy mentioned this pull request Dec 27, 2024
2 tasks
packages/volto/src/icons/save2 2.crdownload Outdated Show resolved Hide resolved
packages/volto/locales/volto.pot Outdated Show resolved Hide resolved
packages/volto/locales/volto.pot Outdated Show resolved Hide resolved
packages/volto/locales/volto.pot Outdated Show resolved Hide resolved
packages/volto/locales/volto.pot Outdated Show resolved Hide resolved
packages/volto/locales/volto.pot Outdated Show resolved Hide resolved
packages/volto/locales/volto.pot Outdated Show resolved Hide resolved
packages/volto/src/icons/save1.svg Outdated Show resolved Hide resolved
packages/volto/cypress/downloads/downloads.html Outdated Show resolved Hide resolved
@stevepiercy
Copy link
Collaborator

@TechSubham I think you made a mistake, as you did not push the requested changes to this branch. See https://6.docs.plone.org/contributing/first-time.html#update-your-pull-request-from-your-fork for how to resolve the issue.

@TechSubham TechSubham force-pushed the Favourite-Tab branch 3 times, most recently from c4f655c to 2df32cc Compare December 27, 2024 23:25
Copy link
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

This is much better. Thank you!

I think this PR also needs documentation in the User Manual as a new section in https://6.docs.plone.org/volto/user-manual/copy-paste-blocks.html, since favorites are a kind of copy/cut and paste operation. Do you agree?

This is a good exercise for first-timers. Code, tests, and documentation. Keep up the good work!

packages/volto/news/2039.feature Outdated Show resolved Hide resolved
packages/volto/locales/volto.pot Outdated Show resolved Hide resolved
packages/volto/locales/volto.pot Outdated Show resolved Hide resolved
Copy link
Collaborator

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

Thank you! Let's get a technical review from the Volto Team next.

@giuliaghisini
Copy link
Contributor

i think there's too much buttons on the right now, and it's not the better solution for mobiie use.. isn't it better to move 'save button' on the top, or bottom of the block like the 'add button'?
We have moved 'add button' on the bottom of the block for the same reason..

@stevepiercy @sneridagh @TechSubham

packages/volto/locales/it/LC_MESSAGES/volto.po Outdated Show resolved Hide resolved
packages/volto/locales/it/LC_MESSAGES/volto.po Outdated Show resolved Hide resolved
packages/volto/locales/it/LC_MESSAGES/volto.po Outdated Show resolved Hide resolved
packages/volto/locales/it/LC_MESSAGES/volto.po Outdated Show resolved Hide resolved
packages/volto/locales/it/LC_MESSAGES/volto.po Outdated Show resolved Hide resolved
packages/volto/src/components/manage/Sidebar/Sidebar.jsx Outdated Show resolved Hide resolved
packages/volto/src/components/manage/Sidebar/Sidebar.jsx Outdated Show resolved Hide resolved
packages/volto/src/components/manage/Sidebar/save.css Outdated Show resolved Hide resolved
@stevepiercy stevepiercy requested a review from a team December 30, 2024 10:48
@@ -0,0 +1,7 @@
.absolute-div {
Copy link
Contributor

Choose a reason for hiding this comment

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

please make this rule more specific, like .drag.block .absolute-div

@@ -1237,6 +1237,16 @@ div.image-upload-widget-image {
}
}

.parent-class {
.absolute-div {
Copy link
Contributor

Choose a reason for hiding this comment

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

why here another rule with same styles definide in save.css?

className="delete-button"
aria-label={intl.formatMessage(messages.delete)}
style={{
marginRight: '3px',
Copy link
Contributor

Choose a reason for hiding this comment

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

move styles into less file

>
<Icon name={trashSVG} size="18px" />
</Button>
<div class="absolute-div">
Copy link
Contributor

Choose a reason for hiding this comment

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

i think it's better to change class name with a more specific name for this case

>
<Icon name={trashSVG} size="18px" />
</Button>
<div class="absolute-div">
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<div class="absolute-div">
<div className="absolute-div">

onClick={() => setIsSaveDialogOpen(true)}
className="save-button"
aria-label={intl.formatMessage(messages.save)}
style={{
Copy link
Contributor

Choose a reason for hiding this comment

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

move styles into less file

@@ -6,7 +6,6 @@ import Icon from '@plone/volto/components/theme/Icon/Icon';
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
import { getContentIcon } from '@plone/volto/helpers/Content/Content';
import config from '@plone/volto/registry';

Copy link
Contributor

Choose a reason for hiding this comment

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

re-add this row to unchange this file

type="button"
className="sidebar-copy-button"
style={{
position: 'absolute',
Copy link
Contributor

Choose a reason for hiding this comment

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

move styles into less please

@@ -1237,6 +1237,16 @@ div.image-upload-widget-image {
}
}

.parent-class {
Copy link
Contributor

Choose a reason for hiding this comment

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

what is .parent-class ?

import trashSVG from '@plone/volto/icons/delete.svg';
import SaveBlockDialog from '@plone/volto/components/manage/Blocks/Block/SaveBlockDialog';
import './save.css';
Copy link
Contributor

Choose a reason for hiding this comment

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

please, create a less file under theme/pastanaga

.sidebar-container {
}
// .sidebar-container {
// }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of commenting code, remove it. It's just noise as a comment.

@stevepiercy
Copy link
Collaborator

i think there's too much buttons on the right now, and it's not the better solution for mobiie use.. isn't it better to move 'save button' on the top, or bottom of the block like the 'add button'?
We have moved 'add button' on the bottom of the block for the same reason..

IMO, I think the Favorites belong under the "Block" tab in the upper-right. After all, we are working with favorite blocks.

I don't like how I have to click the paste icon, then mouse over from the upper-right to the lower-left to paste a favorite block. Why not just single-click and paste the block?

Also it is strange that I have to click on the name of the block to open the Copy Block dialog. I'd prefer a copy icon/button.

@tisto
Copy link
Member

tisto commented Jan 2, 2025

@stevepiercy my PLIP is about the content tree's locations, not favorite blocks. The feature itself is certainly useful. However, I doubt we can integrate this feature into the user interface without completely overwhelming the editors. Maybe providing this feature as an add-on and gaining more experience with it would be a way to go.

@stevepiercy
Copy link
Collaborator

@tisto are you sure that's the right issue? It's not labeled as a PLIP, and its title and description is for adding this exact favorites feature.

@tisto
Copy link
Member

tisto commented Jan 3, 2025

@stevepiercy yes. I am sure about this. I recall creating this ticket after a client request that we got. So far, I never heard the request for favorite blocks (not saying the feature isn't useful).

My thoughts about the UX:

  • the current implementation does not really allow more icons in the UI. Before we can think about features like this we would have to move to a more Quanta-like UI that shows three dots where we can add features like this.
  • the "saved" blocks should be added to the standard blocks chooser to be consistent (that being said the blocks chooser itself is bad UX that we have improve as well)

To sum up. I like the feature. However, solving this UX-wise is non-trivial.

@stevepiercy
Copy link
Collaborator

@tisto this is the link to what you called "my PLIP":

That is not a PLIP. It is a feature request for favorites. What is the link to the PLIP you are talking about?

@ichim-david
Copy link
Member

@tisto this is the link to what you called "my PLIP":

* [As editor I can save favourites in the content browser sidebar #2039](https://github.com/plone/volto/issues/2039)

That is not a PLIP. It is a feature request for favorites. What is the link to the PLIP you are talking about?

@stevepiercy I wonder if @tisto didn't mean to say the content browser, imagine adding an image block and using the object browser where you want to select images and you know it's always from /assets folder. You would have a favorite to that folder and make it easier to get to that path rather than navigating around until you find the asset folder from your current location.

@tisto is my interpretation valid or am I wrong as well?

@tisto
Copy link
Member

tisto commented Jan 3, 2025

@ichim-david you are correct. Sorry for writing a crappy enhancement proposal and not referring to it correctly here.

@stevepiercy yes. #2039 is "my PLIP".

@ichim-david
Copy link
Member

@ichim-david you are correct. Sorry for writing a crappy enhancement proposal and not referring to it correctly here.

@stevepiercy yes. #2039 is "my PLIP".

@stevepiercy @tisto @TechSubham and here we have a prime example of being safer to ask first if a request is still valid and if it is to run by the issue author if what you think needs to be done aligns with what the author thought.

This is a pretty interesting feature and it might make sense to have as an add-on indeed. If it gains some tracks we could think of how to integrate it into Volto core.

@TechSubham as a new contributor to Volto it's always best to ask first before starting to implement something as that gives the best chance for your work not to go to waste on account of different priorities or visions for a feature of bugfix.
Especially when you see an issue light on the description or example you need to double check to ensure the requirement is properly written and understood.

I don't know if you will have any desire to turn this code into an add-on or not and if you will receive any UX feedback further on this feature. I am not dismissing this work nor am I +1 or -1 against it, I'm simply trying to give you some advice on how to approach future contributions to avoid any disappointment.  

@TechSubham
Copy link
Member Author

@eveyone Thank you for taking the time to provide detailed feedback and guidance. I genuinely appreciate the opportunity to collaborate with such experienced contributors, and your insights are incredibly valuable to me as a new contributor to Volto

i will make sure to ask the details about the issue from the author from next time onwards

@Wagner3UB
Copy link
Contributor

I really want to test this feature, as soon as I have time, I’ll take a look.

@djay
Copy link
Member

djay commented Jan 8, 2025

  • the current implementation does not really allow more icons in the UI. Before we can think about features like this we would have to move to a more Quanta-like UI that shows three dots where we can add features like this.

@tisto
I think anyone proposing features should be made aware of the quanta UI figma.
This link isn't shared enough - https://www.figma.com/design/YpaRSKjFcFaAkVYnTSVGuz/Volto-UI-%E2%80%93-Quanta?node-id=1786-928&p=f&t=iRQ63bH4Z6kbZWSs-0
In quanta the tabs in the sidebar goes away which IMO is a good thing. Vertical is better than horizontal, esp on mobile.

  • the "saved" blocks should be added to the standard blocks chooser to be consistent (that being said the blocks chooser itself is bad UX that we have improve as well)

Agreed they should be in the chooser. I don't think they should be in the sidebar at all. if you want to manage them it should perhaps be in the site settings or personal preferences.

I have a plan I will outline later which involves combining the idea of shared saved blocks like this, volto layouts and read only blocks, all into one concept. Because generally if you are reusing content/blocks it's more likely done at an origanisational level and there is a good chance you want the ability to change reused content in multiple places rather than copying it. This is all a hard thing to get right which I why I think this feature could be premature.

@TechSubham as a new contributor to Volto it's always best to ask first before starting to implement something as that gives the best chance for your work not to go to waste on account of different priorities or visions for a feature of bugfix.

@ichim-david I couldn't agree more and I'm suprised to hear you say this given you have seemed to think in the past it's always better to implement a UI first.

I personally think there should be a seperate design forum for plone called "design advice needed" where contributors/developers can get advice on the best UX for new features, plugins or their own client work. Here is not the best place. This might help us get to more well thought out UX, with less wasted effort

@sneridagh
Copy link
Member

@TechSubham Thanks for the effort on putting together this implementation. We all know how hard it is and the time you spend on it. Also, thanks for approaching Plone, and thinking that you could improve it!

As other members of the community already mentioned, Plone has a process to decide what gets in Plone and what does not: The PLIP process The Plone codebase, and the people that uses it is huge and we take very seriously the process to ensure consistency and expectations.

I encourage you to continue the process, given this proof of concept that you provided.

@plone/volto-team Let's put this in the pipeline. Certainly, the "saved blocks" feature is a nice to have one, but it has to be rationalized and discussed, same for the resultant UX.

Honestly, this stress out the feeling that I have that the current "CMSUI real state" in screen has reached its limit, and we need to start thinking in other solutions. However, this is part of a greater and complex discussion.

@ichim-david
Copy link
Member

ichim-david commented Jan 9, 2025

@ichim-david I couldn't agree more and I'm suprised to hear you say this given you have seemed to think in the past it's always better to implement a UI first.

@djay My message has always been from the start to check with the authors of any feature request or bug fix if that request is still valid and to have a short comment where you present what you think would be necessary in order to fix it or have a screenshot with what you think would be fine as a feature. Even more so for first-time contributors who are eager to jump on the occasion to add a pull request without knowing the entire context that is gained only after spending a considerable amount of time in the community and using Volto.

In our past conversations, I have stressed about not letting the quest for perfection bog down the good enough enhancement. I strongly believe that this is the case to this day because I would much rather have three quick fixes that are released in a timely fashion rather than one major fix that is released after six months which means that for six months users will not benefit for any of the fixes that could have been added had we not strived so much for perfection. That can mean UI changes or non-user visible changes, it makes no difference as long as it's an improvement.

There is a case where you need to have a long process of thinking implementation and testing such as when we have some strategic flips that majorly impact our users in the way Volto looks and behaves like. For situations like those it makes sense to have a process where you think it through and you try to make it right.
Even in that case if we wait too long we risk getting to a point where that technique or that software that we want to use to change drastically our current stack ends up being deprecated or obsolete because this is the way the JavaScript world moves.

Our time is limited. Our funds are limited. Our manpower is limited. We don't have the luxury to spend so much time when we know that time means money. If you spend a lot of time, that time could be spent working and getting paid for that. If you would get paid to contribute I'm sure that any company that would be willing to pay to develop something and open source it would not appreciate it if the costs skyrocketed due to long reviews and change requests or to see the effort be stuck and never making it on the product.
Many contributions are made as a labor of love for the open source project that you love because you are part of the community and you are using it in a professional way that also makes you money.

If you are spending so much time going over discussions over discussions or having a pull request get stuck in limbo because of some nit or some extra step that could be added or fixed in another pull request, you really decrease the joy, the desire, and the effectiveness of the person who would be willing to put in the time to simply make this open source software 0.1% better.

Not everyone has the time, the resources and the ability to make this project 10, 20, 50% better because they introduce a major feature or major bug fix. Even when that feature is created, it would be so large that it would take a massive amount of effort to review especially if it has a large architectural change, that it would be very hard for an individual or a company or the community to simply take the time to review it in a timely fashion.

As such, yes, I would much rather have small pull requests with tiny fixes that if there is a problem, it's very easy to review and very easy to revert and if everything works out, then again, you have something that's a bit better than it was before you touched it.

It would also be quite a great momentum builder or booster for both to the individual who gets his pull requests merged and to the reviewer who is able to quickly review and merge a pull request that makes something better to this software that we use and we all want to see it improve.

Everyone is entitled to use their time in any way they see fit. I know you are a person who is deeply dedicated to improving the user experience aka the UX and the UI of Volto and many times that requires a significant investment both in time and money and also vision.

Personally, I don't have the energy and the time to engage in such projects. However, due to my love for this community and the software that I use daily for my work, I would love to see pull requests from individuals who are focused and simply trying to make one fix or improvement to Volto.
It would allow me to take 15 minutes out of my day to make a comment or check the work as part of a review and then to see that work merged.
This way I would feel good about myself because I've done something for the community and I'm sure that the person who got my comment or my review is also glad that I did so.

Everyone expects features and things to improve and be visible from month to month. If you have nothing to show for it as time has passed, you will not get any support going forward because people will lose trust in your ability to improve the product or show that you are actively working on it.

So yes, I want to show that I am working on something, and even though I am not contributing to the greatest feature or bug fix, the steady improvements will be appreciated especially by the users who use the software daily and run into some of the issues that they would love to have at least partially fixed.

@stevepiercy
Copy link
Collaborator

@ichim-david I couldn't agree more and I'm suprised to hear you say this given you have seemed to think in the past it's always better to implement a UI first.

@djay My message has always been from the start to check with the authors of any feature request or bug fix if that request is still valid and to have a short comment where you present what you think would be necessary in order to fix it or have a screenshot with what you think would be fine as a feature. Even more so for first-time contributors who are eager to jump on the occasion to add a pull request without knowing the entire context that is gained only after spending a considerable amount of time in the community and using Volto.

We also carefully documented this process, especially for first-timers, in Work with GitHub issues.

@ichim-david
Copy link
Member

ichim-david commented Jan 9, 2025

@ichim-david I couldn't agree more and I'm suprised to hear you say this given you have seemed to think in the past it's always better to implement a UI first.

@djay My message has always been from the start to check with the authors of any feature request or bug fix if that request is still valid and to have a short comment where you present what you think would be necessary in order to fix it or have a screenshot with what you think would be fine as a feature. Even more so for first-time contributors who are eager to jump on the occasion to add a pull request without knowing the entire context that is gained only after spending a considerable amount of time in the community and using Volto.

We also carefully documented this process, especially for first-timers, in Work with GitHub issues.

@stevepiercy and this is a testament to your huge efforts to improve our documentation, our processes to deal with and think of the first-time contributors. This work was not done in one go, it took several iterations and it will improve again in the future as we come out with ways to improve our work.

I really appreciate all that you are doing for Volto and all of the work on checking every pull request. These improvements would not be possible with only mammoth pull requests from 1 user that would just lead to burnout.

@djay Our docs are not perfect by any imagination, but this iterative approach allowed @erral to write some docs, @stevepiercy to proofread and me to review which meant that now we have 3 extra examples for blocks as seen in this pull request #6560.

I've told @erral that it would have been nice to have an example using an Edit view but I meant when I said that it was not mandatory to get his work merged given the fact that it already contained 2 new examples that we didn't have documented up to this point.

So taking in my own dogfood advice, I wouldn't let the perfect get in the way of the iterative approach to improve Volto in any facet.
Erral made the choice to still write the extra doc and now we have even more docs, but we should be flexible in what we demand from contributions as not everyone has the time to make every fix or implement every feature when requested.
If we really need something there is also the possibility of the reviewer or someone else to also step up and add that missing request.

@djay
Copy link
Member

djay commented Jan 9, 2025

@ichim-david UX is different. Add one thing here and it can make things more confusing over there or harder to do.
But even incremental fixes are being rejected or told to be done as plugins.
My point is that UX changes should be given guidance and help by UX experts before anyone wastes time on implimentation so we don't get more of a UX crazy house than we already have. We even have a really good roadmap in the form of quanta that no one even tries to follow - https://www.figma.com/design/YpaRSKjFcFaAkVYnTSVGuz/Volto-UI-%E2%80%93-Quanta?node-id=1786-928&p=f&t=NT0p9WIAZipeWOZL-0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs discussion
Development

Successfully merging this pull request may close these issues.

8 participants