Add quoting by url / in replies #3431

Open
iamtakingiteasy wants to merge 1 commit from gitlab-mr-iid-2164 into develop

Re-created (now deleted/lost) https://git.pleroma.social/pleroma/pleroma-fe/-/merge_requests/2204 (which will probably start referencing some unrelated changes in the future, when MR ID is re-used)

Current quoting UI implementation only allows to embed a quote in the first post of a thread, referencing another post in replies in federation-compatible way is not possible. Aside from main limitation, current UI is also sticking out disproportionately, at least in the default theme. This MR aims to address both issues by moving quoting controls to it's own form activated by a status action button, similarly to polls, allowing to quote-by-url and choose whether to start a new thread with quote-reply. URL input accepts both /notice/ and resolvable APID links via search v2 API.

Additionally a convenience setting "When quoting, quote replied post in a new thread by default" is added;

  • When enabled, clicking on new "Quote" button auto-fills the URL with post that is being replied to and checks start-new-thread, so behavior matches the click on current radio-button.
  • When disabled, even in replies URL is not prefilled and start-new-thread is unchecked, allowing to readily paste a link to some other post.

As side-effect of using search v2 API, technically a unique combination of terms may also be used to lookup the post to quote.

Changes

  • Replaces quote/reply radio buttons with more subdued quote status action button revealing form with quote url input, start-new-thread checkbox and quote preview.
  • Adds a new setting to control whether quote form should be prefilled with replied post url and start-new-thread prechecked.
  • Fixes API data attached to thrown Errors using constructor cause field, rather than otherwise ignored object.
  • Changes external link for local posts from URL to URI if available, effectively replacing /notice/ link that is available anyway from routing with the APID link that isn't currently available for local posts at all.
  • Removes lower bound on grid-gap between status action buttons to fit quote preview nicely in a left column, when drafting new post.
screenshots

Before:

quote-before-initial
quote-before

After:

quote-after-initial
quote-after-notice
quote-after-apid
quote-after-text

new-post-quote

<!-- Feel free to submit merge requests that are work-in-progress, but mark them as Draft: or WIP:. Merge requests that have Draft or WIP status will not be merged and have less chances of being reviewed, but you can still ask people to take a look if you need advice. --> _Re-created (now deleted/lost) https://git.pleroma.social/pleroma/pleroma-fe/-/merge_requests/2204 (which will probably start referencing some unrelated changes in the future, when MR ID is re-used)_ Current quoting UI implementation only allows to embed a quote in the first post of a thread, referencing another post in replies in federation-compatible way is not possible. Aside from main limitation, current UI is also sticking out disproportionately, at least in the default theme. This MR aims to address both issues by moving quoting controls to it's own form activated by a status action button, similarly to polls, allowing to quote-by-url and choose whether to start a new thread with quote-reply. URL input accepts both /notice/ and resolvable APID links via search v2 API. Additionally a convenience setting "When quoting, quote replied post in a new thread by default" is added; - When enabled, clicking on new "Quote" button auto-fills the URL with post that is being replied to and checks start-new-thread, so behavior matches the click on current radio-button. - When disabled, even in replies URL is not prefilled and start-new-thread is unchecked, allowing to readily paste a link to some other post. As side-effect of using search v2 API, technically a unique combination of terms may also be used to lookup the post to quote. # Changes * Replaces quote/reply radio buttons with more subdued quote status action button revealing form with quote url input, start-new-thread checkbox and quote preview. * Adds a new setting to control whether quote form should be prefilled with replied post url and start-new-thread prechecked. * Fixes API data attached to thrown `Errors` using constructor [cause](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) field, rather than otherwise ignored object. * Changes external link for local posts from URL to URI if available, effectively replacing /notice/ link that is available anyway from routing with the APID link that isn't currently available for local posts at all. * Removes lower bound on grid-gap between status action buttons to fit quote preview nicely in a left column, when drafting new post. <details><summary>screenshots</summary> Before: ![quote-before-initial](/attachments/c98490f7-838b-4cab-89a5-295661cb2d80) ![quote-before](/attachments/032b85a5-638b-4188-8da6-1d0f9d882def) After: ![quote-after-initial](/attachments/c770e6df-ae38-433d-b1e5-ed079f021bcc) ![quote-after-notice](/attachments/7060a58a-4335-4fc8-b8bb-41d28f566fbd) ![quote-after-apid](/attachments/3f1eec55-e00e-40f8-aff8-cf357b7ec233) ![quote-after-text](/attachments/fce95ee2-e654-47b4-9713-ceb047a528ca) ![new-post-quote](/attachments/5b853734-bf11-439b-9f4b-252febe5a37a) </details> <!-- List what your merge request changes and how --> <!-- Try to not to break existing behavior, if your changes do break existing behavior make it configurable to toggle between old behavior and new. Which one should be default is up to discussion. --> <!-- If your merge request resolves some issue link it like so: "Closes #99999" --> <!-- If merge request adds some new feature that depends on backend: 1. Make sure it gracefully degrades if backend hasn't been updated to support the feature, we try to make PleromaFE compatible with older versions of BE so that people can still update frontend safely without updating backend since it's costly and much riskier. 2. Link related BE merge request here --> <!-- Screenshots are welcome -->
Member

can you attach before/after screenshots?

can you attach before/after screenshots?
Author
Member

Added before screenshot, updated after screenshots to match the compared area.

Added before screenshot, updated after screenshots to match the compared area.
Author
Member

Also added initial states.

Also added initial states.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin gitlab-mr-iid-2164:gitlab-mr-iid-2164
git switch gitlab-mr-iid-2164

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch develop
git merge --no-ff gitlab-mr-iid-2164
git switch gitlab-mr-iid-2164
git rebase develop
git switch develop
git merge --ff-only gitlab-mr-iid-2164
git switch gitlab-mr-iid-2164
git rebase develop
git switch develop
git merge --no-ff gitlab-mr-iid-2164
git switch develop
git merge --squash gitlab-mr-iid-2164
git switch develop
git merge --ff-only gitlab-mr-iid-2164
git switch develop
git merge gitlab-mr-iid-2164
git push origin develop
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma-fe!3431
No description provided.