Comments: Further range of content reference ux improvements
Some checks failed
lint-php / build (push) Has been cancelled
test-js / build (push) Has been cancelled
analyse-php / build (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-migrations / build (8.4) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled
test-php / build (8.4) (push) Has been cancelled

- Added reference indicator to comment create form.
  - Added remove action.
- Extracted reference text to translations.
- Changed reference hash to be text-based instead of HTML based.
- Added reference display for newly added comments.
- Handled reference marker delete on comment delete.
This commit is contained in:
Dan Brown
2025-05-01 17:22:12 +01:00
parent 15c79c38db
commit c82fa33210
9 changed files with 74 additions and 28 deletions

View File

@ -131,7 +131,16 @@ export class PageComment extends Component {
await window.$http.delete(`/comment/${this.commentId}`);
this.$emit('delete');
this.container.closest('.comment-branch')?.remove();
const branch = this.container.closest('.comment-branch');
if (branch instanceof HTMLElement) {
const refs = window.$components.allWithinElement<PageCommentReference>(branch, 'page-comment-reference');
for (const ref of refs) {
ref.hideMarker();
}
branch.remove();
}
window.$events.success(this.deletedText);
}