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

feat: Add toggle for editor line length per user #6569

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

azri-cs
Copy link

@azri-cs azri-cs commented Oct 29, 2024

📝 Summary

Fixes #4024

After some direct alignment with designers, we basically want to offer a per user setting to allow users changing between a full line length and a compact line length display mode.

🖼️ Screenshots

🏚️ Before 🏡 After
default full-width

B | A

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

Follow up

  • Hide the toggle for line length in collectives as it has its own option
  • Discuss if moving the toggle to the action menu makes sense

Copy link

codecov bot commented Oct 29, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@max-nextcloud
Copy link
Collaborator

Hi @azri-cs 👋

Looks like this is your first PR to text. 🎉

❤️ Thanks a lot for contributing! I hope we can walk you through finalizing this.
I assume you are addressing #4024 - so I'll add that to the PR description.

First of all, let's check in with @nextcloud/designers to hear if the ui matches their expectations.

In the meantime we can try and address the failing tests:

DCO

The DCO check is complaining about your signoff message in the commits like this:
grafik

If you use git on the command line you can add a signoff message to the last commit with
git commit --amend --signoff.

Lint PHP-cs

At first sight this looks like it's mostly about indentation. Can you see the error message the workflow printed? It has a detailed diff of what needs to be changed.

Psalm

This also looks related:

grafik

I hope these are helpful pointers to address these. If you get stuck feel free to ask. I will also take a first look at the code to see if I find something to comment upon.

Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

Code wise this looks good.

I noticed that you added a string config setting - but I think a boolean would do. If I read #4024 correctly it's either full width or default line length.

src/components/Editor.vue Show resolved Hide resolved
@azri-cs
Copy link
Author

azri-cs commented Oct 31, 2024

Code wise this looks good.

I noticed that you added a string config setting - but I think a boolean would do. If I read #4024 correctly it's either full width or default line length.

Upon reading back the requirements, yes I agree boolean is better since it's a checkbox and there are only 1 option and 1 default. My latest push have implemented this.

@max-nextcloud
Copy link
Collaborator

Dear @azri-cs Thanks for changing the approach and using a boolean. That looks good to me.

The linters are still not quite happy. They mostly disagree about the use of whitespace here and there.
For the javascript side of things you can run the linter locally with:
npm run lint
It looks like all the errors it reports can be fixed automatically. You can do this by running
npx eslint --fix --ext .js,.vue src

For php i'm less familiar but my understanding is that you will need to run composer install first to get all the composer dependencies and then you can run what the CI job also runs:
composer run cs:check for checking and
composer run cs:fix for fixing.

@azri-cs
Copy link
Author

azri-cs commented Nov 1, 2024

Dear @azri-cs Thanks for changing the approach and using a boolean. That looks good to me.

The linters are still not quite happy. They mostly disagree about the use of whitespace here and there. For the javascript side of things you can run the linter locally with: npm run lint It looks like all the errors it reports can be fixed automatically. You can do this by running npx eslint --fix --ext .js,.vue src

For php i'm less familiar but my understanding is that you will need to run composer install first to get all the composer dependencies and then you can run what the CI job also runs: composer run cs:check for checking and composer run cs:fix for fixing.

Hi @max-nextcloud

Sorry for the inconvenience caused. I've followed your advice to use .editorconfig from the server repo, and then I run ctrl+alt+l to format each files I previously committed. Not sure why the whitespaces issue still exists despite of this. I've fix the whitespaces issue on my latest push.

@max-nextcloud
Copy link
Collaborator

Hey @azri-cs
Thanks for following up on this so swiftly. I will ping the design team again for review. Code wise i think this is ready to be merged.
There's a signature missing on one of the commits - but I think it would make sense to squash all of the commits into one anyway so the back and forth with the whitespace changes does not show up in history.

Could you squash the commits?
Feedback from the design team might not arrive before Monday next week as it's the weekend for most of them now.

@azri-cs azri-cs force-pushed the feature/editor-line-length-per-user branch from 236e15d to e67590a Compare November 1, 2024 22:49
@azri-cs
Copy link
Author

azri-cs commented Nov 1, 2024

Hey @azri-cs Thanks for following up on this so swiftly. I will ping the design team again for review. Code wise i think this is ready to be merged. There's a signature missing on one of the commits - but I think it would make sense to squash all of the commits into one anyway so the back and forth with the whitespace changes does not show up in history.

Could you squash the commits? Feedback from the design team might not arrive before Monday next week as it's the weekend for most of them now.

Hi @max-nextcloud

No worries. I've squashed my commits into one commit. Thanks a lot, I've learnt a lot.

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Very nice contribution @azri-cs! :) I only have 1 feedback: I would expect a setting like this to be in the collapsed part of the toolbar along with these other more info/settings like items, as the "people" menu is more focused on collaboration and sharing.
(Also, this setting is disabled by default, right?)
image

@juliusknorr
Copy link
Member

@jancborchardt I'm considering this as a follow up, as I scoped the task for @azri-cs to put it explicitly in that menu in the beginning.

@juliusknorr juliusknorr added enhancement New feature or request 3. to review labels Nov 4, 2024
@jancborchardt
Copy link
Member

@juliusknorr @azri-cs sure, doing it as a follow-up is fine for me too. :)

My remark does make sense though right, or would you still prefer your originally suggested placement?

Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

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

The code looks good and works like a charm. Let's get this in as a first iteration and I'll file follow up issues for polishing.

@juliusknorr
Copy link
Member

My remark does make sense though right, or would you still prefer your originally suggested placement?

I'm undecided on that part as currently all the menu items are just buttons and having a global toggle there seems out of place a bit, but I also see that the "collaborator" menu is not ideal as well.

@juliusknorr
Copy link
Member

@azri-cs Thanks for the fixes as well. Seems we have a conflicting file meanwhile. Could you rebase your changes against the latest main branch and resolve the conflict?

@juliusknorr
Copy link
Member

Collected follow up topics in the pr description to file in separate issues after merging the first step

auto-merge was automatically disabled November 7, 2024 15:10

Head branch was pushed to by a user without write access

@azri-cs
Copy link
Author

azri-cs commented Nov 7, 2024

@azri-cs Thanks for the fixes as well. Seems we have a conflicting file meanwhile. Could you rebase your changes against the latest main branch and resolve the conflict?

Sorry @juliusknorr , I'm facing few issues:

  1. Upon resolving the conflict via Github.com it created a merge commit from main with my branch. It was because the conflict doesn't appear on my local even when I run git rebase main hence why I used Github.com instead.
  2. And then afterwards, I just realized I missed one line of code and pushed a new commit as a fix.

Are these okay? If not, what should I do?

@juliusknorr
Copy link
Member

Would be great if you could rebase and squash it into one commit locally. Unfortunately GitHub doesn't allow that with the conflict reduction web ui

@azri-cs azri-cs force-pushed the feature/editor-line-length-per-user branch 2 times, most recently from dda40d0 to 5856b02 Compare November 10, 2024 09:07
@azri-cs azri-cs force-pushed the feature/editor-line-length-per-user branch from 5856b02 to 9f0b406 Compare November 10, 2024 09:21
@azri-cs
Copy link
Author

azri-cs commented Nov 10, 2024

Would be great if you could rebase and squash it into one commit locally. Unfortunately GitHub doesn't allow that with the conflict reduction web ui

Hi Julius,

Is this correct? How can I resolve the new conflicting files as I did not receive the conflict files locally to solve even when running git rebase origin/main?

Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@max-nextcloud
Copy link
Collaborator

@azri-cs

Is this correct? How can I resolve the new conflicting files as I did not receive the conflict files locally to solve even when running git rebase origin/main?

Looks like something with the earlier squash went wrong. Now the branch includes commits that have already been on main branch etc.

The last good commit seems to have been e67590a (before #6569 (comment))

So I suggest you start again from there. Could you try if this works for you:

git reset --hard e67590af683d7d85c9c7c49023aa4cea8abd4e0e

It does not work for me - but that might be because I do not have that commit in my own git repo as it only was on your repo.

@juliusknorr
Copy link
Member

One additional hint your origin remote is probably your fork with is behind the upstream repository. Mabye also try updating your fork with the latest changes on the main branch at https://github.com/azri-cs/text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configurable line-length for Editor
4 participants