Commit Graph

691 Commits

Author SHA1 Message Date
Kevin Ansfield
0ac36bd324 Shipped comments-ui@0.22.4
no issue

- includes fix for reply-to-reply form not showing when parent comment is hidden
2024-11-21 18:49:18 +00:00
Kevin Ansfield
d1019a8e54 Fixed reply-to-reply comment form not showing when parent is hidden
closes https://linear.app/ghost/issue/PLG-266

- the reply form is a child of the parent comment component but we have different comment components for published vs unpublished with the bug coming from the latter missing the logic to display the form
- added missing form display and added a regression test
2024-11-21 18:44:23 +00:00
Kevin Ansfield
e5a21aaf54 Shipped comments-ui@0.22.3
no issue

- includes fix for missing progress indicator when submitting forms
2024-11-21 16:12:31 +00:00
Kevin Ansfield
0b806cc01b 🐛 Fixed missing progress indicator when submitting comments
closes https://linear.app/ghost/issue/PLG-265

- wrapped the async part of `dispatchAction` in a Promise so code that calls it can await the action completion
  - this was a regression introduced a long time ago when we switched to Typescript and React hooks
- added a `setDelay()` method to our `MockedApi` class to make it easier to test interstitial loading states
2024-11-21 16:03:30 +00:00
Ronald Langeveld
4202cf137e
Bumped Comments-UI to 0.22.2 (#21678)
no issue
2024-11-21 11:04:41 +00:00
Ronald Langeveld
cf6884d098
Wired up Admin Comment Endpoints to UI (#21661)
ref PLG-227

- Updated logic that allows Admin Users on comments to interact with
some endpoints from a specific admin-only route.
- It pulls 2 admin specific routes:
- 1. an admin specific 'browse' route that includes hidden comments that
would otherwise be hidden from regular users and members.
- 2. A specific replies route, that would also include hidden comments
- This was needed in order to get accurate pagination.

- Additionally, it wires up the routes via `message-handler` that deal
with the potential cors issues.
- Includes style updates

---------

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2024-11-21 10:52:36 +00:00
Kevin Ansfield
33709e7d0c Shipped comments-ui@0.22.1
no issue

- includes updated timestamp formatting
2024-11-20 15:30:53 +00:00
Sanne de Vries
ea1b786136
Updated timestamp format for comments (#21515)
ref https://linear.app/ghost/issue/PLG-235

- Any comments older than yesterday are now shown with the date instead of relative time
- Comments from the current year are now shown with just the month and day

---------

Co-authored-by: Kevin Ansfield <kevin@ghost.org>
2024-11-20 15:25:49 +00:00
Kevin Ansfield
46bdbaa3b8 Shipped comments-ui@0.22.0
no issue

- includes updates behind `commentImprovements` flag
- bumped to 0.22 to avoid changes going live before next Ghost release
2024-11-20 12:33:53 +00:00
Sanne de Vries
5bbb98b661
Hooked up the CTA popup to the reply button (#21663)
REF
https://linear.app/ghost/issue/PLG-262/unhide-the-reply-button-when-comments-is-paywalled
- Previously, the reply button was hidden when the comments were
paywalled. Now, the button is visible and triggers a signup or upgrade
popup.
2024-11-20 10:10:50 +01:00
Kevin Ansfield
52e727a28c
Added in-reply-to references to comments-ui (#21656)
ref https://linear.app/ghost/issue/PLG-230

When clicking "Reply" on a reply we now show an "In reply to" reference on the form and when saved show that reference in the rendered view, making it easier to follow discussions within comment replies.

- updated calls to `openCommentForm` action when opening a reply to add the in-reply-to data to the `openForm` instance
- updated Form comment to use the `openForm` instance data when rendering the in-reply-to reference
- updated Comment component to render the in-reply-to reference from the API-provided data
  - includes click handler to scroll to the referenced comment
- added `getCommentInReplyToSnippet` helper function so strip a comment back to plaintext for display in the reply-to reference on the comment form (snippets on other comments are generated server-side)

---------

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2024-11-19 17:30:18 +00:00
Sanne de Vries
0d417a5859
Updated hide comment button to be red (#21641)
REF
https://linear.app/ghost/issue/PLG-239/indicate-that-youre-an-admin-in-ui
2024-11-18 13:10:06 +01:00
Kevin Ansfield
5ef30dbb3c Shipped comments-ui@0.21.10
no issue

- includes fix for incorrect avatar showing in comment reply forms
2024-11-18 11:36:35 +00:00
Kevin Ansfield
49595dce0f 🐛 Fixed avatar on comment reply form not showing your avatar
closes https://linear.app/ghost/issue/PLG-260
ref https://github.com/TryGhost/Ghost/pull/21621

- in a recent refactor, a `comment` prop started being passed through to `<Form>` inside of `<ReplyForm>` which had an unexpected side-effect of changing the avatar image to the comment's member instead of the logged-in member
- removed the prop passthrough and updated test to catch future regressios
2024-11-18 11:30:48 +00:00
Steve Larson
7ff02f46ec
Bumped comments package (#21632)
no ref
- includes new translations
2024-11-15 19:12:58 +00:00
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
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
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
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
Kevin Ansfield
c0a00cabe4 Bumped Comments-UI to 0.21.8
no issue
2024-11-05 10:55:50 +00: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
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
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
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
Ronald Langeveld
cca6a38e53
Patched Comments UI v0.20.1 (#21464)
no issue

---------

Co-authored-by: Sanne de Vries <65487235+sanne-san@users.noreply.github.com>
2024-10-30 10:06:11 +00:00
Sanne de Vries
119a913ce5
Fixed comment form being cut off at the top (#21463)
No ref
2024-10-30 08:56:42 +00:00
Sanne de Vries
456af29607
Fixed avatar initials being broken in comment form (#21448)
REF PLG-248
2024-10-29 10:44:00 +00:00
Chris Raible
af0f26c75f
Added Dev Container setup (#21279)
no issue

- Dev Containers let you work on Ghost in a consistent, isolated
environment with all the necessary development dependencies
pre-installed. VSCode (or Cursor) can effectively run _inside_ the
container, providing a local quality development environment while
working in a well-defined, isolated environment.
- For now the default setup only works with "Clone repository in
Container Volume" or "Clone PR in Container Volume" — this allows for a
super quick and simple setup. We can also introduce another
configuration to allow opening an existing local checkout in a Dev
Container, but that's not quite ready yet.
- This PR also added the `yarn clean:hard` command which: deletes all
node_modules, cleans the yarn cache, and cleans the NX cache. This will
be necessary for opening a local checkout in a Dev Container.
- To learn more about Dev Containers, read this guide from VSCode:
https://code.visualstudio.com/docs/devcontainers/containers#_personalizing-with-dotfile-repositories

---------

Co-authored-by: Joe Grigg <joe@ghost.org>
Co-authored-by: Steve Larson <9larsons@gmail.com>
2024-10-24 11:15:08 -07:00
Ronald Langeveld
96239d31a6
Added Comments Sorting UI (#21375)
ref PLG-220

- Added UI for Comments Sorting on the Comments UI App.

Co-authored-by: Sanne de Vries <65487235+sanne-san@users.noreply.github.com>
2024-10-24 19:01:14 +09:00
renovate[bot]
eb85af051f Update tiptap monorepo to v2.9.0 2024-10-22 13:57:37 +00:00
Steve Larson
f759f1e042
Bumped comments-ui (#21347)
no ref
2024-10-20 08:28:32 -05:00
Cathy Sarisky
324211f64d
fix build for search, signup, comments = 80-90% reduction in size! (#21342)
no ref

This change to vite.config.js fixes errors in the sodo-search,
signup-form, and comments packages, preventing inclusion of all of
i18n/locales. As the number of translated strings has gotten larger,
these builds have increased significantly in size, bloated with strings
that aren't actually present in them (in 58 different languages!)

No obvious build errors are present with these changes, but an extra
eyes would be appreciated. Vite isn't my forte.

---------

Co-authored-by: Steve Larson <9larsons@gmail.com>
2024-10-17 12:35:56 -05:00
renovate[bot]
864e7b27e4 Update dependency tailwindcss to v3.4.14 2024-10-15 15:58:30 +02:00
Kevin Ansfield
65d84fad17 Refactored cta/main form conditional in comments-ui
no issue

- micro-refactor that came out of a bigger draft-replies refactor, splitting out early to keep main change cleaner
- adjusted nested ternary style and naming to improve clarity
- added unit tests to ensure the logic behaviour stayed consistent
- cleaned up useless dummy unit test file
2024-10-15 12:50:12 +01:00
Kevin Ansfield
f982bbe9fa Extracted comment member name and initial helper functions
no issue

- extracted functions for easier re-use and testing
- removed duplicate definition of comment member initials function
2024-10-15 07:53:57 +01:00
Steve Larson
77ab8baa82
Bumped comments-ui (#21217)
no ref
- bumped to include i18n changes
2024-10-03 21:40:00 +00:00
renovate[bot]
e2d20d5c49 Update tiptap monorepo to v2.8.0 2024-09-30 16:05:32 +00:00
Kevin Ansfield
26f429be78 Shipped comments-ui@0.18.3 2024-09-26 17:56:28 +01:00
Sanne de Vries
5a251b5cac
Fixed comment form visual issues (#21138)
REF PLG-225
- When editing a comment, the form was not aligned correctly.
- The form has more height by default now even when not focused, to
increase engagement.
2024-09-26 18:35:01 +02:00
renovate[bot]
bec6371e5c Update tiptap monorepo to v2.7.4 2024-09-26 13:01:56 +00:00
renovate[bot]
7b274497d2 Update tiptap monorepo to v2.7.3 2024-09-25 19:46:00 +00:00
Kevin Ansfield
4389140853 Shipped comments-ui@0.18.2 2024-09-25 16:19:58 +01:00
Sanne de Vries
68c3d99f15
Fixed various visual details in Comments UI (#21121)
REF PLG-225
- Updated placeholder text color to work in dark mode
- Fixed spacing for reply input field
- Changed comment input field styles
- Changed left border width from 3px to 1px
- Updated "Expertise" modal typography
- Updated CTA typography
2024-09-25 17:11:53 +02:00
Kevin Ansfield
175d76c831 Shipped comments-ui@0.18.1 2024-09-25 16:02:57 +01:00
Kevin Ansfield
2bca5efcec Added reply button to comment replies
closes https://linear.app/tryghost/issue/PLG-221

- added `toggleParentReplyMode()` to comment component's props so clicking Reply on a reply opens the reply form on the top-level parent to emphasise we only support 1-level deep replies and avoid unexpected nesting
- adjusted conditional so "Reply" button is shown in `<CommentMenu>` when a parent is present (behind labs flag)
- updated `useLabs()` to always return an object so we don't need to add nullish checks everywhere

# Conflicts:
#	apps/comments-ui/test/e2e/actions.test.ts
2024-09-25 15:49:56 +01:00
Kevin Ansfield
a996cde39d Fixed flaky member expertise test
no issue

- a change in browser version/dependency versions/playwright/something else has made this test flaky because the reply editor form loses focus when the expertise field gains focus (this doesn't happen in the browser) meaning when we get to our assertions the elements we care about are missing
- forcing focus back puts us into a known state for our assertions
2024-09-25 15:25:34 +01:00
renovate[bot]
b6e5c0fe68 Update tiptap monorepo to v2.7.2 2024-09-25 12:13:09 +00:00
Kevin Ansfield
eb3824383b Shipped comments-ui@0.18.0
no issue

- general styling and design updates
2024-09-24 10:46:23 +01:00