Commit Graph

2070 Commits

Author SHA1 Message Date
Kevin Ansfield
0ac587e94a
Refactored comments-ui form management (#21621)
ref https://linear.app/ghost/issue/PLG-230
closes https://linear.app/ghost/issue/PLG-256

Adding an in-reply-to reference link/snippet to reply forms was proving difficult with the previous setup due the amount of data that needed to be passed up and down a deeply nested component tree. This refactor lays the groundwork for making that easier and aims to make form autoclose behaviour more centralised by keeping the open form state in app context and the opening/closing of forms in actions so there's less need for messy local state and to drill functions down the component tree.

- replaces `openFormCount` context state with an `openCommentForms` array
  - keeping detailed open form references in the application state means the display of forms is centrally managed rather than managed via local state inside components
  - it simplifies some of the problems faced with the `<PublishedComment>` component that previously managed form display. That component is re-used for both the top-level comment as well as replies even though replying on a reply puts the top-level comment into reply mode meaning we had a mess of local state and passed-through functions to work around the component having varying behaviour depending on nesting level
  - `openFormCount` is still available on the application state via `useMemo` on the provider meaning the implementation of `openCommentForms` is hidden from app code that just needs to know if forms are open
- removes `<AutocloseForm>` as the autoclose behaviour is now controlled via the `openCommentForm` action
- updated `<Form>` so it manages the "has unsaved changes" properties on `openFormComments` ready for use by `openCommentForm`'s autoclosing behaviour
2024-11-14 18:26:23 +00:00
Djordje Vlaisavljevic
86641268ab Stopped HTML cards with fixed width from causing overflow in the drawer
close https://linear.app/ghost/issue/AP-557/elements-in-articles-can-cause-horizontal-scrolling
2024-11-14 17:45:59 +00:00
Djordje Vlaisavljevic
6bf69b6a07
Fixed drawer “Back” button appearing in the wrong place (#21624)
ref https://linear.app/ghost/issue/AP-587/back-button-appears-in-wrong-spot-when-article-is-reached-through-a
2024-11-14 17:45:37 +00:00
Djordje Vlaisavljevic
af54b21bf3
Fixed separator showing even after the last list item (#21620)
close
https://linear.app/ghost/issue/AP-528/remove-unnecessary-separator-after-last-list-items

- Previously, in some components, we relied on CSS and all elements in
the list being the same type of an HTML element to show the separator.
Now, we've extracted the separator into its own component and place
after all items during mapping except the last one.
2024-11-14 17:42:43 +00:00
Djordje Vlaisavljevic
2a0ad25edc
Fixed activity badges not showing when the user doesn't have a profile icon (#21609)
ref https://linear.app/ghost/issue/AP-575/badges-are-not-showing-up-on-placeholder-avatars
2024-11-14 11:15:00 +00:00
Djordje Vlaisavljevic
5e5d5dc5da
Updated menu items to not trigger parent element on click (#21618)
close https://linear.app/ghost/issue/AP-576/clicking-copy-link-to-post-shouldnt-open-the-drawer

- Clicking on a menu item in the `...` dropdown now doesn’t trigger click handlers on parent elements, but it does close the Menu

Co-authored-by: Fabien O'Carroll <fabien@allou.is>
2024-11-14 11:13:37 +00:00
Ronald Langeveld
e254ddbd17
🐛 Fixed marketplace theme installation route (#21616)
no issue

- Fixes a potential regression that caused the marketplace install route
not to route correctly.
2024-11-14 03:41:47 +00:00
Djordje Vlaisavljevic
5863c40306
Improved Inbox view UI (#21600)
ref https://linear.app/ghost/issue/AP-521/improve-inbox-view-alignmentstructure

- Improved the layout, spacing and typography of Inbox view
- Removed attachment counters for images in Inbox view
- Added a very very small variant of `APAvatar`
2024-11-13 11:45:37 +00:00
Kevin Ansfield
097394bd88 Fixed flaky avatar saturation test in comments-ui
no issue

- running tests locally, especially in UI mode, would often result in an avatar saturation test failing
- the cause was calculating saturation for an element that still had it's opacity animating in
- added a test util function that waits for an element in a frame to reach full opacity
- used function in test to ensure we have a stable element before calculating the color saturation
2024-11-12 17:10:44 +00:00
Michael Barrett
0f2058cc2a
Fixed inbox tab not showing user's own posts in admin-x-activitypub (#21601)
refs
[AP-588](https://linear.app/ghost/issue/AP-588/inbox-tab-not-showing-users-own-posts)

Fixed inbox tab not showing user's own posts in admin-x-activitypub by
ensuring that the `includeOwn` parameter is set to `true` when fetching
the activities for the inbox tab
2024-11-12 15:59:26 +00:00
Fabien 'egg' O'Carroll
d555cc6612
Handled non-string preferredUsername values (#21598)
ref https://linear.app/ghost/issue/AP-585

If preferredUsername is not a string, and we attempt to render it, we
will crash the entire React application!
2024-11-12 21:22:45 +07:00
John O'Nolan
e7a80d79f3
Updated link to Pintura integration 2024-11-12 08:52:17 -05:00
Sodbileg Gansukh
9ffc5ca79a
Fixed embeddable signup form preview and generated code (#21592)
ref ENG-1671
2024-11-12 14:33:52 +08:00
Princi Vershwal
7f158c0e18
🐛 Fixed Admin navigation settings, pressing ENTER will now create a new navigation item (#21591)
Ref
https://linear.app/ghost/issue/DES-73/enter-should-create-new-navigation-itemmove-to-next-field
2024-11-12 05:10:15 +00:00
Sodbileg Gansukh
c41bc5c237
Fixed table row hover effect in Safari (#21586)
ref DES-951
2024-11-12 10:51:51 +08:00
Djordje Vlaisavljevic
ea11367ea4
Stopped loading spinner flash when you first open Search page (#21569)
close
https://linear.app/ghost/issue/AP-531/search-spinner-flashes-for-a-split-second-when-switching-tab-for-the

- Fixed the logic for displaying “loading” and “no results found” states
- Refactored the component to avoid nested ternaries
2024-11-11 11:36:04 +00:00
Sodbileg Gansukh
177e604501
Added custom fonts (#21564)
ref DES-949

This adds custom fonts feature allowing users to select heading and body fonts for their themes from a curated list. This allows publishers to have more control over their brand, and allows themes to have a wider range of styles to appeal to different audiences. 

Without custom fonts support, themes will continue to work as normal, but users won't be able to customize their typography. As for the official themes, all of them will support custom fonts.

---------

Co-authored-by: Aileen Booker <AileenCGN@gmail.com>
2024-11-11 18:38:02 +08:00
Djordje Vlaisavljevic
b55ac9a03a
Fixed Articles appearing squeezed when opened from Notifications or Profile (#21587)
close
https://linear.app/ghost/issue/AP-581/article-content-appears-squeezed-when-opened-from-notifications-or
2024-11-11 09:31:04 +00:00
Ronald Langeveld
c349b9bf26
Added new hidden comments API implementation (#21444)
ref PLG-227

- Behind flags
- Changed Comments API for members and guests to not return hidden or
removed comments - with the only exception being if a hidden or removed
comment have published replies, in which case it will be greyed out as
per the previous version on the UI.
- Wired up a new admin API endpoint for comment to receive all comments.
It's on par with the members / guests endpoint, with the difference
being that it it shows hidden comment's content, where previously the
html property was nullified.
2024-11-11 15:00:59 +08:00
Djordje Vlaisavljevic
5138ef8ed3 Bumped admin-x-activitypub package
ref https://linear.app/ghost/issue/AP-522/inbox-view-thumbnail-size-inconsistencies
2024-11-07 17:36:03 +00:00
Djordje Vlaisavljevic
a9a72f9445 Made hover states for list items look nicer
ref https://linear.app/ghost/issue/AP-506/suggested-profiles-hover-refinement, https://linear.app/ghost/issue/AP-530/notifications-list-hover-state-is-inconsistent-with-the-rest, https://linear.app/ghost/issue/AP-516/profile-view-hover-state-on-profile
2024-11-07 17:36:03 +00:00
Djordje Vlaisavljevic
c5861a7664 Made all thumbnails in Inbox layout the same width
ref https://linear.app/ghost/issue/AP-522/inbox-view-thumbnail-size-inconsistencies
2024-11-07 17:36:03 +00:00
Djordje Vlaisavljevic
3709a4811e
Improved ActivityPub drawer view UI (#21521)
ref https://linear.app/ghost/issue/AP-507/inbox-view-missing-min-width-for-inbox-card, https://linear.app/ghost/issue/AP-562/remove-unused-viewfollowersmodal-and-viewfollowingmodal-files, https://linear.app/ghost/issue/AP-559/add-post-stats-and-buttons-to-articles-in-drawer-view, https://linear.app/ghost/issue/AP-468/drawer-visual-refinements, https://linear.app/ghost/issue/AP-558/add-actor-info-to-articles-in-drawer-view, https://linear.app/ghost/issue/AP-573/add-anchor-link-to-replies-in-the-drawer

- Made `Articles` in drawer view wider for better reading experience
- Added `Actor` info to `Articles` in drawer view for more context about who posted it
- Added `Like` and `Reply` buttons and counters to `Articles` in drawer view
- Clicking on a Reply notification or Reply icon in the drawer view now scrolls you directly to replies
- Removed modals we’re no longer using
- Updated `RoutingProvider` so it can work without any modals passed to
it
2024-11-07 15:59:29 +00:00
Daniël van der Winden
eae76703eb
Custom Integrations and Webhooks layout fixes (#21565)
fixes
https://linear.app/ghost/issue/DES-790/some-urls-not-wrapping-in-integration-detail-modal

- Webhook URLs were breaking out of the modal container. They now wrap
across a few lines.
- Long descriptions of Custom Integrations caused the integration's icon
to scale down. That no longer happens.
- Descriptions of Custom Integrations wrap properly.
2024-11-07 14:24:15 +00:00
Daniël van der Winden
86ecedf079
Revert "Admin navigation settings fix (#21323)" (#21563)
This reverts commit eaed33972f.

The fix we shipped for using the `RETURN` key to create navigation items
in Admin broke something with regards to saving the URL, so we're
reverting that change.
2024-11-07 12:34:34 +01:00
Sanne de Vries
5f7734bf36
Fixed comments dropdown menu being cutoff by iframe (#21555)
REF https://linear.app/ghost/issue/PLG-255/dropdown-cut-off-by-iframe
- Avoided menu cutoff by positioning the dropdown of the last comment
above the MoreButton
2024-11-07 11:39:52 +01:00
Fabien 'egg' O'Carroll
466d7fef3f
Bumb admin-x-activitypub to 0.3.10 (#21546)
closes https://linear.app/ghost/issue/AP-523
2024-11-06 11:07:17 +00:00
Sodbileg Gansukh
9516d144a0
Used theme package name for hiding theme-specific font settings (#21545)
ref DES-929
2024-11-06 10:42:32 +00:00
Sodbileg Gansukh
e25d5cc105
Hide typography related theme settings from official themes (#21530)
ref DES-929
2024-11-06 12:26:20 +08:00
Fabien 'egg' O'Carroll
b591912c74
Updated the local state after following an account (#21509)
refs https://linear.app/ghost/issue/AP-523

We want to preempt the Accept activity from our Follows, so we make the
assumption that it's succeeded. What this means is that we have to
update our `following`, `followingCount` as well as the fetched profile
to set the `isFollowing` property. This gives a more fluid user
experience when following accounts and keeps our state up to date.

Accounts where the follow request has to be accepted manually, are a
little trickier as we don't currently have easy access to the "requested
but not accepted state"
2024-11-06 00:15:39 +07:00
Kevin Ansfield
c0a00cabe4 Bumped Comments-UI to 0.21.8
no issue
2024-11-05 10:55:50 +00:00
Daniël van der Winden
9d0e4e7d45
Updated Signup Page (#21434)
fixes
https://linear.app/ghost/issue/DES-881/sign-up-flow-on-mobile-with-checkbox-on-requires-ux-improvement

On mobile, the Sign Up button is no longer sticky. This ensures
customers scroll down and see the checkbox before they hit the button.

If they do still miss the checkbox, we now have a check in place that
— if the checkbox is the last missing thing — scrolls the checkbox into
view upon submission.

https://github.com/user-attachments/assets/5d7867b6-d60c-4844-9482-af04a0eb1eaf
2024-11-05 10:51:14 +01:00
Ronald Langeveld
c77080f977
Fixed comments placeholder (#21524)
ref PLG-251

- Fixed comments placeholder to change from "Start the conversation" to
"Join the discussion" when there's more than 1 comment.
- Previously, it only worked after a refresh. This fix ensures it's
reactive and would update the placeholder without the need for a
refresh.
2024-11-05 12:14:29 +09:00
Daniël van der Winden
6e8e817a47
Makes newsletter comments toggle conditional (#21517)
fixes
https://linear.app/ghost/issue/DES-796/shouldnt-show-email-template-option-when-commenting-is-disabled

Previously, if you had comments turned off on your site, you would still
see the toggle in newsletter settings. Clicking it would do nothing.

Now, if comments are enabled (for all members, or paid members), it will
show; if they're not, it won't.



https://github.com/user-attachments/assets/80b8e2dc-a0ed-40bc-ada5-40141676e38b
2024-11-04 16:18:04 +01:00
Sodbileg Gansukh
264e362e06
Fixed sticky unsubscribe from all button on mobile (#21514)
ref DES-785
2024-11-04 11:41:16 +00:00
Sanne de Vries
d32cae4284
Hide sorting form when there is one or zero comments (#21513)
REF PLG-250
2024-11-04 12:33:26 +01:00
Sanne de Vries
599a526dd7
Used comment count to determine which text to show in the CTA box (#21512)
REF PLG-251
- This change uses commentCount instead of isFirst to ensure that the
CTA box text is correct regardless of layout.
2024-11-04 12:07:23 +01:00
Michael Barrett
0316c3f16e
Updated admin-x-activitypub to use consistent URL encoding (#21493)
refs
[TryGhost/ActivityPub](https://github.com/TryGhost/ActivityPub/pull/103)

Updated the API requests made by the `admin-x-activitypub` app to use
consistent URL encoding when making requests to the ActivityPub API
2024-11-04 10:40:06 +00:00
Sanne de Vries
73884e8f69
Added CTA popup to comments like button (#21484)
REF PLG-246
- Whenever a user clicks the like button and they are not allowed to
like comments (either not signed in or not a paid member) we now show a
CTA popup asking them to sign in or upgrade to a paid membership.

---------

Co-authored-by: Kevin Ansfield <kevin@ghost.org>
2024-11-04 11:29:31 +01:00
Sodbileg Gansukh
c9f5b72b3c
Made visual updates to the custom fonts selector (#21510)
ref DES-930
2024-11-04 16:42:04 +08:00
Ronald Langeveld
d675dec74e
Bump Comments-UI to 0.21.7 (#21508)
no issue
2024-11-04 02:49:21 +00:00
Ronald Langeveld
fd463f69bd
Bumped Comments UI to 0.21.0 (#21445)
ref PLG-220
2024-11-04 02:40:14 +00:00
Cathy Sarisky
8f9a89c1a5
🎨 Updated Portal to accept data-locale (#21420)
no issue

This change adds the ability to pass a desired language/locale into
portal, as a data-locale tag added to the script that loads it.

Falls back to the previous behavior, loading from the site settings, if
no data-locale is present. (And then to 'en', if necessary.) No change
in expected behavior if data-locale is not passed.

This provides an option to run portal in a language other than the
sitewide language.

(ref: https://app.slack.com/client/T025584C4/C018EKC56JF)
2024-11-02 14:19:46 +00:00
Michael Barrett
b90e16219d
Refactored collection retrieval in admin-x-activitypub (#21491)
no refs

Refactored collection retrieval to reduce code duplication and
complexity
2024-10-31 20:31:20 +00:00
Michael Barrett
3ecfe08e1d
Added failure state for reply in admin-x-activitypub (#21487)
no refs

Added a failure state for when a reply fails to be sent
2024-10-31 16:34:53 +00:00
Michael Barrett
dd2ed27d9d
Removed unused useAllActivitiesForUser hook and related code in admin-x-activitypub app (#21482)
no refs

Removed unused `useAllActivitiesForUser` hook and related code. This was
a left over from when we added paginated activities
2024-10-31 11:40:41 +00:00
renovate[bot]
085afdeb74 Pin dependency clsx to 2.1.1 2024-10-31 11:02:29 +00:00
Djordje Vlaisavljevic
45711e197c
AP design bugs (#21395)
- Fixed links in profile description
- Stripped post content
- Fixed grey bg in Avatars
- Installed `clsx`

---------

Co-authored-by: Michael Barrett <mike@ghost.org>
2024-10-31 10:50:51 +00:00
renovate[bot]
4f4662490f
Update Koenig packages (#21480) 2024-10-31 10:11:27 +00:00
Djordje Vlaisavljevic
824efc7f10
Added UUID as data attribute to posts in all views (#21470)
ref
https://linear.app/ghost/issue/AP-404/add-uuid-as-a-data-attribute-in-the-dom-for-easier-db-lookup

- This will allow us to find posts in the DB

Co-authored-by: Michael Barrett <mike@ghost.org>
2024-10-31 10:07:52 +00:00