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

Add Inline comment experimental flag #60622

Merged
merged 274 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 94 commits
Commits
Show all changes
274 commits
Select commit Hold shift + click to select a range
10c9ed0
Update comment functionality and reformating code
MD-sunilprajapati Jun 10, 2024
271895a
remove style import
MD-sunilprajapati Jun 10, 2024
f2b7114
Merge pull request #8 from MD-sunilprajapati/try/inline-block-commenting
poojabhimani12 Jun 10, 2024
5e0890c
revert the changes
MD-sunilprajapati Jun 10, 2024
031e8d5
resolved conflicts
poojabhimani12 Jun 10, 2024
6b0c3b3
Merge branch 'poojabhimani12:try/inline-block-commenting' into try/in…
MD-sunilprajapati Jun 10, 2024
d2d6215
Adjust spacing between icons
MD-sunilprajapati Jun 10, 2024
cbee86f
Merge pull request #9 from MD-sunilprajapati/try/inline-block-commenting
poojabhimani12 Jun 10, 2024
b36c2ab
resolved conflicts
poojabhimani12 Jun 10, 2024
b7b1ba4
Fix linting errors
MD-sunilprajapati Jun 11, 2024
6c0862d
Merge pull request #10 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 12, 2024
77ee009
Add experimental condition
MD-sunilprajapati Jun 13, 2024
a8ea60e
Show sidebar on zero comments
MD-sunilprajapati Jun 13, 2024
ec302ff
Add package lock
MD-sunilprajapati Jun 13, 2024
f002607
Merge pull request #11 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 13, 2024
fdc44a3
Update comment
MD-sunilprajapati Jun 14, 2024
bb2c0bd
Merge pull request #12 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 14, 2024
e6ac0b4
Address feedbacks
MD-sunilprajapati Jun 18, 2024
9447911
Use useEntityProp
MD-sunilprajapati Jun 18, 2024
bf84cc4
Update sidebar content on new comment
MD-sunilprajapati Jun 18, 2024
57ed39a
Remove unneccessory changes
MD-sunilprajapati Jun 19, 2024
b9668fd
Relocate border styles for commented blocks
MD-sunilprajapati Jun 19, 2024
6628689
Merge pull request #13 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 19, 2024
1d81922
set initial state instead of mount effect for block class
MD-sunilprajapati Jun 19, 2024
87fe4f9
Fix linting errors
MD-sunilprajapati Jun 19, 2024
139135d
Add dependencies
MD-sunilprajapati Jun 19, 2024
20f2bd3
Merge pull request #14 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 19, 2024
2df0bdb
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 Jun 19, 2024
515a592
Update package lock
MD-sunilprajapati Jun 19, 2024
08fd837
Merge pull request #15 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Jun 20, 2024
251ae5f
Implement inline commenting
MD-sunilprajapati Jun 20, 2024
e747430
Update doc for collabboard component
MD-sunilprajapati Jun 20, 2024
b7a5bd7
Highlight inline text with comment
MD-sunilprajapati Jun 20, 2024
16d2186
Remove comments and console logs
MD-sunilprajapati Jul 24, 2024
877f090
Merge pull request #16 from MD-sunilprajapati/enabled-inline-commenting
poojabhimani12 Jul 25, 2024
1ce0191
made changes for collab.php file and removed block border color
rishishah-multidots Jul 29, 2024
1a677d8
Merge pull request #17 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Jul 29, 2024
d67d2b1
Resolved conflicts
poojabhimani12 Jul 29, 2024
e0cb8b5
Merge branch 'try/inline-block-commenting' of https://github.com/pooj…
poojabhimani12 Jul 29, 2024
9004004
Update editor-settings.php
poojabhimani12 Jul 29, 2024
d23a0a6
made changes for block comment feature
rishishah-multidots Aug 22, 2024
cf605d5
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Aug 22, 2024
f115c3b
made changes for code_sniffer error on rest_api file
rishishah-multidots Aug 22, 2024
f748ad9
made changes for code_sniffer error on rest_api file
rishishah-multidots Aug 22, 2024
59e96c4
remove readme.md file from collab folder
rishishah-multidots Aug 22, 2024
18e5081
remove static email for comment author
rishishah-multidots Aug 22, 2024
c9f4964
Merge pull request #18 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Aug 22, 2024
1ed6d54
added edit/delete comment from sidebar feature
rishishah-multidots Aug 23, 2024
84733c5
resolve PHP coding standards errors
rishishah-multidots Aug 23, 2024
2d5d162
resolve PHP coding standards errors
rishishah-multidots Aug 23, 2024
e68cdcc
Merge pull request #19 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Aug 23, 2024
8042e22
Resolved Conflicts
poojabhimani12 Aug 28, 2024
ceb188c
Add idenrifier to collab sidebar
MD-sunilprajapati Aug 28, 2024
575361c
Relocate Add Comment button below in more action popover
MD-sunilprajapati Aug 29, 2024
8c45982
Update comment button action to focus new comment form in sidebar on …
MD-sunilprajapati Aug 29, 2024
a2345e8
Merge pull request #20 from MD-sunilprajapati/try/inline-block-commen…
poojabhimani12 Aug 29, 2024
2004c04
Update experimental field lable for commenting functionality
MD-sunilprajapati Aug 29, 2024
8ac8328
Revert format library changes
MD-sunilprajapati Aug 29, 2024
868c095
made changes as per Github
rishishah-multidots Aug 29, 2024
ab73559
Refactor collab sidebar
MD-sunilprajapati Aug 29, 2024
d5df8cc
Refactor collab sidebar
MD-sunilprajapati Aug 29, 2024
533c5d4
Remove unneccessory snapshot tests
MD-sunilprajapati Aug 29, 2024
c0a5dcd
Remove collab board component
MD-sunilprajapati Aug 29, 2024
56e475b
Fix linting errors
MD-sunilprajapati Aug 29, 2024
9de8c69
Merge pull request #21 from MD-sunilprajapati/collab-sidebar-update
poojabhimani12 Aug 29, 2024
4104869
made changes as per Github
rishishah-multidots Aug 29, 2024
b8b0292
made changes as per github feedback
rishishah-multidots Aug 29, 2024
6996e5f
Merge pull request #22 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Aug 29, 2024
0321430
comment board hide/show on Add comment and cancel button
rishishah-multidots Aug 29, 2024
3bf3c4c
Merge pull request #23 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Aug 29, 2024
c66fbcd
Revert format library changes
MD-sunilprajapati Aug 30, 2024
751d727
Sync with trunk and resolved conflicts
MD-sunilprajapati Aug 30, 2024
9a42d64
Merge pull request #24 from MD-sunilprajapati/address-feedbacks
poojabhimani12 Aug 30, 2024
68d5e1c
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 Aug 30, 2024
1f5a2c2
Focus comment board on comment icon click
MD-sunilprajapati Aug 30, 2024
6477102
Address feedback and create smaller component
MD-sunilprajapati Aug 30, 2024
66832a7
Create comment header component
MD-sunilprajapati Aug 30, 2024
5c70d90
Fix linting errors
MD-sunilprajapati Aug 30, 2024
cc28c6a
Remove logs
MD-sunilprajapati Aug 30, 2024
951d8b4
Fix linting errors
MD-sunilprajapati Aug 30, 2024
b0ad9d5
Merge pull request #25 from MD-sunilprajapati/refactor-collab-sidebar
poojabhimani12 Aug 30, 2024
a5e12e1
made changes as per PR feedback
rishishah-multidots Aug 30, 2024
cf59158
made changes as per PR feedback
rishishah-multidots Aug 30, 2024
6cfdb29
resolve style.scss conflict
rishishah-multidots Aug 30, 2024
465b438
Merge pull request #26 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Aug 30, 2024
c9d50d8
Refactor collab components
MD-sunilprajapati Sep 2, 2024
fd6f327
Implement comment reload on comment crud operation
MD-sunilprajapati Sep 2, 2024
15c85e0
remove string literals for data stores
MD-sunilprajapati Sep 2, 2024
c7be827
remove package json file changes
MD-sunilprajapati Sep 2, 2024
bd1a7ce
Add docs for components
MD-sunilprajapati Sep 2, 2024
19dfab8
Merge pull request #27 from MD-sunilprajapati/refactor-inline-commenting
poojabhimani12 Sep 2, 2024
48ee928
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 Sep 2, 2024
8fa3f85
remove revert function to show comments in sidebar and show comments …
rishishah-multidots Sep 2, 2024
5f0ae80
remove revert function to show comments in sidebar and show comments …
rishishah-multidots Sep 2, 2024
69d1878
Merge pull request #28 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 2, 2024
d6e01f3
Remove string literels for gutenberg stores
MD-sunilprajapati Sep 2, 2024
668671b
Merge pull request #29 from MD-sunilprajapati/refactor-inline-comment…
poojabhimani12 Sep 2, 2024
ee6fe75
Sync with trunk and resolved conflicts
MD-sunilprajapati Sep 3, 2024
de2cd8f
Sync with trunk
MD-sunilprajapati Sep 3, 2024
8e6da19
Addressed feedback of collab sidebar component
MD-sunilprajapati Sep 3, 2024
90ba459
Merge pull request #30 from MD-sunilprajapati/collab-sidebar-feedbacks
poojabhimani12 Sep 3, 2024
e2fd75a
made changes for feedback
rishishah-multidots Sep 3, 2024
aad19d0
Merge pull request #31 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 3, 2024
6f03c48
Refresh state on every new comment
MD-sunilprajapati Sep 3, 2024
2b057cc
Sync file with trunk
MD-sunilprajapati Sep 3, 2024
59caf1c
made changes for css property
rishishah-multidots Sep 3, 2024
efa41ac
Merge pull request #32 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 3, 2024
4ee210d
code cleanup
MD-sunilprajapati Sep 3, 2024
38bea58
Merge pull request #33 from MD-sunilprajapati/collab-sidebar-cleanup
poojabhimani12 Sep 3, 2024
609cad6
Merge branch 'trunk' of gutenberg
MD-sunilprajapati Sep 4, 2024
8a54986
Update classes name and remove unwanted classes
minaldiwan Sep 4, 2024
2fd78b0
Merge pull request #35 from minaldiwan/try/inline-block-commenting
poojabhimani12 Sep 4, 2024
f236a42
made changes for translators and context
rishishah-multidots Sep 4, 2024
b3c879d
made changes for translators and context
rishishah-multidots Sep 4, 2024
bc308e9
Merge pull request #36 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 4, 2024
11cf1f1
use entity record function instead api fetch
MD-sunilprajapati Sep 4, 2024
22c189a
Sync with origin and resolved coflicts
MD-sunilprajapati Sep 4, 2024
33cd398
small fix for translator string
rishishah-multidots Sep 4, 2024
211944c
Merge pull request #37 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 4, 2024
a4abbec
Fix linting errors
MD-sunilprajapati Sep 4, 2024
5c99dcc
Merge branch 'try/inline-block-commenting' of gutenberg into collab-c…
MD-sunilprajapati Sep 4, 2024
50e8101
fix comment edit issue
MD-sunilprajapati Sep 5, 2024
ce7f7bc
Sync with origin and resolved coflicts
MD-sunilprajapati Sep 5, 2024
b0c5960
Fix linting errors
MD-sunilprajapati Sep 5, 2024
f768b4a
Merge pull request #34 from MD-sunilprajapati/collab-comment-cleanup
poojabhimani12 Sep 5, 2024
92870c4
pipeline error fixes
rishishah-multidots Sep 5, 2024
37fa922
pipeline error fixes and resolve conflicts
rishishah-multidots Sep 5, 2024
4d6841a
Merge pull request #38 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 5, 2024
71f7a39
Fix linting errors
MD-sunilprajapati Sep 5, 2024
6f73a0b
Merge pull request #39 from MD-sunilprajapati/code-cleanup
poojabhimani12 Sep 5, 2024
edab788
Fix style linting issue
MD-sunilprajapati Sep 5, 2024
6e528a1
Fix useMemo dependacy
MD-sunilprajapati Sep 5, 2024
b129367
Merge pull request #40 from MD-sunilprajapati/fix-linting-errors
poojabhimani12 Sep 5, 2024
8d17f22
Remove styling for input and textarea box as per core team feedback
minaldiwan Sep 5, 2024
fd4c045
Merge pull request #41 from minaldiwan/try/inline-block-commenting
poojabhimani12 Sep 5, 2024
4d3eeb1
added error message for add comment on draft mode or duplicate comment
rishishah-multidots Sep 5, 2024
f06340a
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Sep 5, 2024
6b8027a
resolve eslint error and update blockEditorStore feature
rishishah-multidots Sep 5, 2024
06c8526
revert package files as per trunk
rishishah-multidots Sep 5, 2024
e1d4396
revert package files as per main branch
rishishah-multidots Sep 5, 2024
c78f981
Merge pull request #42 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 5, 2024
da72b79
Addressed feedback
MD-sunilprajapati Sep 6, 2024
d7bca6e
cleanup code
MD-sunilprajapati Sep 6, 2024
68d203e
Update context for edit button
MD-sunilprajapati Sep 6, 2024
b296d2d
Merge pull request #43 from MD-sunilprajapati/address-feedback
poojabhimani12 Sep 6, 2024
bddceeb
feedback changes
rishishah-multidots Sep 6, 2024
c5094a0
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Sep 6, 2024
a23241a
feedback changes for comment rest API
rishishah-multidots Sep 6, 2024
9548565
Merge pull request #44 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 6, 2024
06e840f
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 Sep 6, 2024
3883a11
comment rest api function in condition
rishishah-multidots Sep 6, 2024
334daf2
Merge pull request #45 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 6, 2024
b028876
Merge branch 'WordPress:trunk' into try/inline-block-commenting
poojabhimani12 Sep 9, 2024
cd63f6a
Fix reply comment issue
MD-sunilprajapati Sep 10, 2024
9b12661
Merge pull request #50 from MD-sunilprajapati/fix-reply-comment-issue
poojabhimani12 Sep 10, 2024
f287eff
Remove comment icon
MD-sunilprajapati Sep 10, 2024
16ebd4c
Merge pull request #51 from MD-sunilprajapati/remove-icon
poojabhimani12 Sep 10, 2024
7aa5508
update comment icon code for menu and toolbar group
rishishah-multidots Sep 13, 2024
e55109f
resolve eslint errors
rishishah-multidots Sep 13, 2024
f66d825
revert package-lock file
rishishah-multidots Sep 13, 2024
7ff9a79
Merge pull request #59 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 13, 2024
d01c693
resolve trunk conflicts
rishishah-multidots Sep 16, 2024
2caf2d1
Merge pull request #60 from rishishah-multidots/sync-with-trunk
poojabhimani12 Sep 16, 2024
6bda66d
sync rest-api file with api PR
rishishah-multidots Sep 24, 2024
64b1b31
sync rest-api file with api PR
rishishah-multidots Sep 24, 2024
31ea3b5
Merge pull request #61 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Sep 24, 2024
bdf982f
remove autop package and update code according to it
rishishah-multidots Oct 3, 2024
c5a53a2
remove console statement
rishishah-multidots Oct 3, 2024
c0aee07
remove linting error
rishishah-multidots Oct 3, 2024
1a251ba
remove tag replace code from add/edit/fetch comment
rishishah-multidots Oct 3, 2024
452181d
remove tag replace code from add/edit/fetch comment
rishishah-multidots Oct 3, 2024
898a924
revert rahHRML tag for render comment in sidebar
rishishah-multidots Oct 3, 2024
11d6693
Merge pull request #64 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 3, 2024
0326444
resolve conflict
rishishah-multidots Oct 3, 2024
bf20345
Merge pull request #65 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 3, 2024
c419ce4
Merge branch 'trunk' of github.com:MD-sunilprajapati/gutenberg into s…
MD-sunilprajapati Oct 4, 2024
667163e
Remove unneccessory changes
MD-sunilprajapati Oct 4, 2024
25364d8
Merge pull request #67 from MD-sunilprajapati/sync-with-trunk
poojabhimani12 Oct 4, 2024
5a53245
Add backport changelog
MD-sunilprajapati Oct 4, 2024
f4dd385
Merge pull request #68 from MD-sunilprajapati/backport-log
poojabhimani12 Oct 4, 2024
83a5955
Merge branch 'trunk' of github.com:rishishah-multidots/gutenberg into…
rishishah-multidots Oct 15, 2024
ec1a8b3
Merge pull request #69 from rishishah-multidots/sync-with-trunk
poojabhimani12 Oct 15, 2024
2a4a427
update feedback points regarding classes and typography
minaldiwan Oct 15, 2024
ffc7f51
Merge pull request #70 from minaldiwan/try/inline-block-commenting
poojabhimani12 Oct 15, 2024
0d36a58
feedback changes
rishishah-multidots Oct 15, 2024
ed6e2e6
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Oct 15, 2024
9a6556f
linting error fixes
rishishah-multidots Oct 15, 2024
ebc28ca
Merge pull request #71 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 15, 2024
02bd950
made changes for private API and comment controller
rishishah-multidots Oct 16, 2024
f5be6ac
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Oct 16, 2024
973f559
remove comment code and added comment controller file
rishishah-multidots Oct 16, 2024
e3c49b7
Merge pull request #72 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 16, 2024
ab1395c
fix conding standerds warnings and error
rishishah-multidots Oct 16, 2024
f9f24d9
fix coding standard warnings and error
rishishah-multidots Oct 16, 2024
63f915f
fix coding standard warnings and error
rishishah-multidots Oct 16, 2024
fc43c1e
Merge pull request #73 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 16, 2024
68c5272
Implement confirmDialog box for delete and resolve comment box
minaldiwan Oct 17, 2024
3d14991
Merge pull request #74 from minaldiwan/try/inline-block-commenting
poojabhimani12 Oct 17, 2024
6b32fcf
feedback changes
rishishah-multidots Oct 17, 2024
9db107b
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Oct 17, 2024
c92de93
made changes to hide block_comment from admin screen
rishishah-multidots Oct 17, 2024
97a6d6e
fix coding standard warnings and error
rishishah-multidots Oct 17, 2024
0136fae
fix coding standard warnings and error
rishishah-multidots Oct 17, 2024
13f53d8
fix coding standard warnings and error
rishishah-multidots Oct 17, 2024
4d0ca6e
fix coding standard warnings and error
rishishah-multidots Oct 17, 2024
c5b76e8
updated doc file
rishishah-multidots Oct 17, 2024
02aabd9
Merge pull request #75 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 17, 2024
65e1eb4
Merge branch 'trunk' of github.com:rishishah-multidots/gutenberg into…
rishishah-multidots Oct 17, 2024
e3bc354
Merge pull request #76 from rishishah-multidots/sync-with-trunk
poojabhimani12 Oct 17, 2024
c8ff644
fix delete comment on reply feedback
rishishah-multidots Oct 18, 2024
8cd46c3
Merge pull request #77 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 18, 2024
45f9553
fix private API import from same API test cases fail errors
rishishah-multidots Oct 21, 2024
27ab929
Merge branch 'try/inline-block-commenting' of github.com:rishishah-mu…
rishishah-multidots Oct 21, 2024
b9017a4
Merge pull request #78 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 21, 2024
e3cb45b
fix e2e error while testing
rishishah-multidots Oct 21, 2024
c4d4b1d
made conditional changes for default attributes
rishishah-multidots Oct 21, 2024
345c227
Merge pull request #79 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 21, 2024
7a6c085
made openGeneralSidebar to private
rishishah-multidots Oct 21, 2024
aa2d47b
Merge pull request #80 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 21, 2024
7ce91e9
made changes as per the feedback
rishishah-multidots Oct 22, 2024
4cd5835
made changes as per the feedback
rishishah-multidots Oct 22, 2024
00076ff
made changes as per the feedback
rishishah-multidots Oct 22, 2024
7bf2c78
Merge pull request #81 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 22, 2024
514853c
made changes as per the feedback
rishishah-multidots Oct 22, 2024
4b59a86
made changes as per the feedback
rishishah-multidots Oct 22, 2024
1cfd88e
Merge pull request #82 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 22, 2024
45f6ac9
made changes as per the feedback
rishishah-multidots Oct 22, 2024
42a4eb2
Merge pull request #83 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 22, 2024
e42e647
remove components fields css
minaldiwan Oct 23, 2024
8744c83
made changes as per the feedback
rishishah-multidots Oct 23, 2024
127228b
Merge branch 'poojabhimani12:try/inline-block-commenting' into try/in…
rishishah-multidots Oct 23, 2024
5781530
Merge pull request #84 from minaldiwan/try/inline-block-commenting
poojabhimani12 Oct 23, 2024
ca54345
Merge pull request #85 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
2e212c1
made changes as per the feedback
rishishah-multidots Oct 23, 2024
4b8986b
Merge pull request #86 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
b42cd97
made changes as per the feedback
rishishah-multidots Oct 23, 2024
30ddf61
Merge pull request #87 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
e446297
made changes as per the feedback
rishishah-multidots Oct 23, 2024
1955469
made changes as per the feedback
rishishah-multidots Oct 23, 2024
22893f8
Merge pull request #88 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
b89ce85
made changes as per the feedback
rishishah-multidots Oct 23, 2024
3f9d745
Merge pull request #89 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
90b038b
define empty array outside the component
rishishah-multidots Oct 23, 2024
b7c0c46
Merge pull request #90 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
48c3351
made changes to compatible with FSE
rishishah-multidots Oct 23, 2024
7c00570
Merge pull request #91 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
047e07f
made changes to compatible with FSE
rishishah-multidots Oct 23, 2024
a342e27
Merge pull request #92 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
ae50d7a
fix lint error
rishishah-multidots Oct 23, 2024
2ca51c3
Merge pull request #93 from rishishah-multidots/try/inline-block-comm…
poojabhimani12 Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 70 additions & 1 deletion lib/compat/wordpress-6.6/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function wp_api_template_access_controller( $args, $post_type ) {
/**
* Adds the post classes to the REST API response.
*
* @param array $post The response object data.
* @param array $post The response object data.
*
* @return array
*/
Expand Down Expand Up @@ -157,3 +157,72 @@ function gutenberg_register_wp_rest_themes_template_directory_uri_field() {
}
}
add_action( 'rest_api_init', 'gutenberg_register_wp_rest_themes_template_directory_uri_field' );

/**
* Preload theme and global styles paths to avoid flash of variation styles in post editor.
*
* @param array $paths REST API paths to preload.
* @param WP_Block_Editor_Context $context Current block editor context.
* @return array Filtered preload paths.
*/
function gutenberg_block_editor_preload_paths_6_6( $paths, $context ) {
Copy link
Member

Choose a reason for hiding this comment

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

We'll need to bump the version, since 6.6 has been released already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have copied the code to the WordPress 6.7 version folder.

if ( 'core/edit-post' === $context->name ) {
$paths[] = '/wp/v2/global-styles/themes/' . get_stylesheet();
$paths[] = '/wp/v2/themes?context=edit&status=active';
$paths[] = '/wp/v2/global-styles/' . WP_Theme_JSON_Resolver_Gutenberg::get_user_global_styles_post_id() . '?context=edit';
}
return $paths;
}
add_filter( 'block_editor_rest_api_preload_paths', 'gutenberg_block_editor_preload_paths_6_6', 10, 2 );

/**
* Updates comment metadata from a REST API request.
*
* This function is hooked to the `rest_prepare_comment` filter and is responsible for updating the comment metadata based on the data provided in the REST API request.
*
* It performs the following tasks:
* - Updates the `block_comment` metadata for the comment based on the `meta` field in the request.
* - Updates the `comment_type` and `comment_approved` fields for the comment based on the corresponding fields in the request.
* - Retrieves the author's avatar URLs and adds them to the response data.
* - Retrieves the `block_comment` metadata for the comment and adds it to the response data.
*
* @param WP_REST_Response $response The response object.
* @param WP_Comment $comment The comment object.
* @param WP_REST_Request $request The request object.
* @return WP_REST_Response The updated response object.
*/
if ( ! function_exists( 'update_comment_meta_from_rest_request' ) ) {
function update_comment_meta_from_rest_request( $response, $comment, $request ) {

if ( isset( $request['comment_type'] ) && ! empty( $request['comment_type'] ) ) {
Copy link
Member

Choose a reason for hiding this comment

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

isset() is redundant if we're already checking if it's ! empty(). No variable can be "not set" if it's not empty.

Suggested change
if ( isset( $request['comment_type'] ) && ! empty( $request['comment_type'] ) ) {
if ( ! empty( $request['comment_type'] ) ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

$comment_data = array(
'comment_ID' => $comment->comment_ID,
'comment_type' => $request['comment_type'],
'comment_approved' => isset( $request['comment_approved'] ) ? $request['comment_approved'] : 0,
);

wp_update_comment( $comment_data );
Copy link
Member

Choose a reason for hiding this comment

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

Updating a comment in the database in the middle of a REST request to return a comment feels incorrect. Can we find a better place / time to do it? What's the real reason to perform the update in the first place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The primary reason for updating the comment in the middle of a REST request is to accommodate the storage of a custom comment_type. Currently, the REST API does not support a parameter for passing this information with the request.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds like we're solving the problem the wrong way. Should we extend the endpoint to support this parameter instead?

}

$author = get_user_by( 'login', $response->data['author_name'] );
Copy link
Member

Choose a reason for hiding this comment

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

Does it make more sense to retrieve the comment author by email instead of by author_name? The thing with author name is that a comment can be left by someone who doesn't have a user, but their author name would correspond to a particular existing username. That can't happen with emails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We did not receive an email address from Gutenberg when fetching the current user's data using select('core').getCurrentUser().

To resolve this, we initially fetched the user's data by username. However, we have modified the code to retrieve user avatar URLs using the user ID instead.

if ( $author ) {
$avatar_url = get_avatar_url( $author->ID );
Copy link
Member

Choose a reason for hiding this comment

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

Also, get_avatar_url() works with emails, so you can retrieve the avatar URL without needing $author in the first place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we now fetch the avatar URL using the user ID, we have removed the get_user_by function from the code.

$response->data['author_avatar_urls'] = array(
'default' => $avatar_url,
'48' => add_query_arg( 's', 48, $avatar_url ),
'96' => add_query_arg( 's', 96, $avatar_url ),
);
}

$comment_id = $comment->comment_ID;
$meta_key = 'block_comment';
$meta_value = get_comment_meta( $comment_id, $meta_key, true );

if ( ! empty( $meta_value ) ) {
Copy link
Member

Choose a reason for hiding this comment

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

The thing with using ! empty() with meta values is that if I add a comment "0" it will be considered empty, and won't be added to the endpoint response. Meta values are essentially strings, so we might be better off checking the length of the meta value - if it's 1 or more, then let's add it.

Suggested change
if ( ! empty( $meta_value ) ) {
if ( strlen( $meta_value ) > 0 ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

$response->data['meta'] = $meta_value;
}

return $response;
}
}
add_filter( 'rest_prepare_comment', 'update_comment_meta_from_rest_request', 10, 3 );
43 changes: 43 additions & 0 deletions lib/experimental/collab.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Functions to support collaboration.
*
* @package gutenberg
*/

if ( ! function_exists( 'register_post_meta_for_collab_comment' ) ) {
/**
* Registers the collab meta field required for comments to work.
*
* @since // TODO: Add version number.
*/
function register_post_meta_for_collab_comment() {
$post_types = get_post_types( array( 'show_in_rest' => true ) );

foreach ( $post_types as $post_type ) {
Copy link
Member

Choose a reason for hiding this comment

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

We might be doing a bunch of unnecessary iterations here.

You could do it with a more advanced get_post_types query (untested):

Suggested change
$post_types = get_post_types( array( 'show_in_rest' => true ) );
foreach ( $post_types as $post_type ) {
$post_types = get_post_types(
array(
'show_in_rest' => true,
'supports' => array( 'editor', 'custom-fields', 'revisions' ),
)
);
foreach ( $post_types as $post_type ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

get_post_types function does not have "supports" parameter to it's argument as refer to its documentation.

Copy link
Member

Choose a reason for hiding this comment

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

The documentation definitely needs a bit of love, but with get_post_types() you can filter by any of the register_post_type() fields. That's what wp_filter_object_list does under the hood - it can filter by any of the object fields. Let me know if that helps.

// Only register the meta field if the post type supports the editor, custom fields, and revisions.
if (
post_type_supports( $post_type, 'editor' ) &&
post_type_supports( $post_type, 'custom-fields' ) &&
post_type_supports( $post_type, 'revisions' )
) {
Copy link
Member

Choose a reason for hiding this comment

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

This check won't be necessary if we expand the get_post_types() query as suggested above.

register_post_meta(
$post_type,
'collab',
array(
'show_in_rest' => true,
'single' => true,
'type' => 'string',
'revisions_enabled' => true,
)
);
}
}
}
}

/*
* Most post types are registered at priority 10, so use priority 20 here in
* order to catch them.
*/
add_action( 'init', 'register_post_meta_for_collab_comment', 20 );
9 changes: 9 additions & 0 deletions lib/experimental/editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ function gutenberg_enable_experiments() {
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-zoomed-out-patterns-tab', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableZoomedOutPatternsTab = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-block-comment', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableBlockComment = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-quick-edit-dataviews', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalQuickEditDataViews = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-block-bindings-ui', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalBlockBindingsUI = true', 'before' );
}
Copy link
Member

Choose a reason for hiding this comment

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

Did we add these by accident / through a bad rebase?

}

add_action( 'admin_init', 'gutenberg_enable_experiments' );
Expand Down
36 changes: 36 additions & 0 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,42 @@ function gutenberg_initialize_experiments_settings() {
)
);

add_settings_field(
'gutenberg-quick-edit-dataviews',
__( 'Quick Edit in DataViews', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Allow access to a quick edit panel in the pages data views.', 'gutenberg' ),
'id' => 'gutenberg-quick-edit-dataviews',
)
);
Copy link
Member

Choose a reason for hiding this comment

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

Was this added by accident through a bad rebase or something?


add_settings_field(
'gutenberg-block-comment',
__( 'Comments', 'gutenberg' ),
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this title can be more self-explanatory - "Comments" doesn't say enough. Perhaps "Block Comments" or "Collaborative Block Comments"?

'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Enable multi-user commenting on blocks', 'gutenberg' ),
Copy link
Member

Choose a reason for hiding this comment

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

This should say something about being internal or for collaborators.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We’ve made this update based on the feedback provided here: #60622 (comment).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm happy to defer to Matías if he has suggestions. Perhaps: "Enable collaborative commenting on blocks."?

'id' => 'gutenberg-block-comment',
)
);

add_settings_field(
'gutenberg-block-bindings-ui',
__( 'UI to create block bindings', 'gutenberg' ),
'gutenberg_display_experiment_field',
'gutenberg-experiments',
'gutenberg_experiments_section',
array(
'label' => __( 'Add UI to create and update block bindings in block inspector controls.', 'gutenberg' ),
'id' => 'gutenberg-block-bindings-ui',
)
);

Copy link
Member

Choose a reason for hiding this comment

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

Was this added by accident through a bad rebase or something?

register_setting(
'gutenberg-experiments',
'gutenberg-experiments'
Expand Down
1 change: 1 addition & 0 deletions lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

require_once __DIR__ . '/init.php';
require_once __DIR__ . '/upgrade.php';
require_once __DIR__ . '/experimental/collab.php';

/**
* Checks whether the Gutenberg experiment is enabled.
Expand Down
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/block-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@wordpress/commands": "file:../commands",
"@wordpress/components": "file:../components",
"@wordpress/compose": "file:../compose",
"@wordpress/core-data": "file:../core-data",
Copy link
Member

Choose a reason for hiding this comment

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

I don't think adding @wordpress/core-data as a dependency here makes a lot of sense. @youknowriad, correct me if I'm wrong, but I think @wordpress/block-editor is intentionally kept separate, standalone, and uninformed about WordPress and is intended to be used in a non-WordPress context.

"@wordpress/data": "file:../data",
"@wordpress/date": "file:../date",
"@wordpress/deprecated": "file:../deprecated",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ import { pipe, useCopyToClipboard } from '@wordpress/compose';
* Internal dependencies
*/
import BlockActions from '../block-actions';
import BlockCommentMenuItem from '../collab/block-comment-menu-item';
import BlockHTMLConvertButton from './block-html-convert-button';
import __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';
import BlockSettingsMenuControls from '../block-settings-menu-controls';
import BlockParentSelectorMenuItem from './block-parent-selector-menu-item';
import { store as blockEditorStore } from '../../store';
import { unlock } from '../../lock-unlock';

const isBlockCommentExperimentEnabled =
window?.__experimentalEnableBlockComment;

const POPOVER_PROPS = {
className: 'block-editor-block-settings-menu__popover',
placement: 'bottom-start',
Expand Down Expand Up @@ -64,6 +68,7 @@ export function BlockSettingsDropdown( {
selectedBlockClientIds,
openedBlockSettingsMenu,
isContentOnly,
blockCommentID,
} = useSelect(
( select ) => {
const {
Expand All @@ -84,6 +89,11 @@ export function BlockSettingsDropdown( {
const parentBlockName =
_firstParentClientId && getBlockName( _firstParentClientId );

const commentID =
// eslint-disable-next-line @wordpress/data-no-store-string-literals
select( 'core/block-editor' ).getBlock( firstBlockClientId )
Copy link
Member

Choose a reason for hiding this comment

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

Let's use the store definition instead:

import { store as blockEditorStore } from '../../store';
// ...
select( blockEditorStore ).getBlock( firstBlockClientId )
// ...

This applies to the rest of the instances throughout the PR.

?.attributes?.blockCommentId;

return {
firstParentClientId: _firstParentClientId,
onlyBlock: 1 === getBlockCount( _firstParentClientId ),
Expand All @@ -100,6 +110,7 @@ export function BlockSettingsDropdown( {
openedBlockSettingsMenu: getOpenedBlockSettingsMenu(),
isContentOnly:
getBlockEditingMode( firstBlockClientId ) === 'contentOnly',
blockCommentID: commentID,
};
},
[ firstBlockClientId ]
Expand Down Expand Up @@ -278,6 +289,13 @@ export function BlockSettingsDropdown( {
</MenuItem>
</>
) }
{ isBlockCommentExperimentEnabled &&
! blockCommentID && (
<BlockCommentMenuItem
clientId={ clientIds }
onClose={ onClose }
/>
) }
</MenuGroup>
{ canCopyStyles && ! isContentOnly && (
<MenuGroup>
Expand Down
16 changes: 16 additions & 0 deletions packages/block-editor/src/components/block-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import BlockControls from '../block-controls';
import __unstableBlockToolbarLastItem from './block-toolbar-last-item';
import BlockSettingsMenu from '../block-settings-menu';
import { BlockLockToolbar } from '../block-lock';
import BlockCommentToolbar from '../collab/toolbar';
import { BlockGroupToolbar } from '../convert-to-group-buttons';
import BlockEditVisuallyButton from '../block-edit-visually-button';
import { useShowHoveredOrFocusedGestures } from './utils';
Expand Down Expand Up @@ -65,6 +66,7 @@ export function PrivateBlockToolbar( {
shouldShowVisualToolbar,
showParentSelector,
isUsingBindings,
blockCommentID,
} = useSelect( ( select ) => {
const {
getBlockName,
Expand Down Expand Up @@ -96,6 +98,12 @@ export function PrivateBlockToolbar( {
( clientId ) =>
!! getBlockAttributes( clientId )?.metadata?.bindings
);

const commentID =
// eslint-disable-next-line @wordpress/data-no-store-string-literals
select( 'core/block-editor' ).getBlock( selectedBlockClientId )
?.attributes?.blockCommentId || null;

return {
blockClientId: selectedBlockClientId,
blockClientIds: selectedBlockClientIds,
Expand All @@ -115,6 +123,7 @@ export function PrivateBlockToolbar( {
selectedBlockClientIds.length === 1 &&
_isDefaultEditingMode,
isUsingBindings: _isUsingBindings,
blockCommentID: commentID,
};
}, [] );

Expand Down Expand Up @@ -192,6 +201,13 @@ export function PrivateBlockToolbar( {
/>
</>
) }

{ blockCommentID && (
<BlockCommentToolbar
clientId={ blockClientId }
blockClassName={ blockCommentID }
/>
) }
</ToolbarGroup>
</div>
) }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { MenuItem } from '@wordpress/components';
import { collabComment } from '@wordpress/icons';
import { useSelect, useDispatch } from '@wordpress/data';

export default function BlockCommentMenuItem( { onClose } ) {
// eslint-disable-next-line @wordpress/data-no-store-string-literals
const { openGeneralSidebar } = useDispatch( 'core/edit-post' );
Copy link
Member

Choose a reason for hiding this comment

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

This looks concerning beyond using a string literal for the store name. The block-editor package is expected to be WordPress-agnostic, so accessing the edit post store doesn't make sense. This likely hints that this component should live in another package, closer to the post editor.

This applies to multiple instances in that PR that attempt to use the edit post store in the block editor package.


// eslint-disable-next-line @wordpress/data-no-store-string-literals
const { updateBlockAttributes } = useDispatch( 'core/block-editor' );

const clientId = useSelect( ( select ) => {
// eslint-disable-next-line @wordpress/data-no-store-string-literals
const { getSelectedBlockClientId } = select( 'core/block-editor' );
return getSelectedBlockClientId();
}, [] );

const openCollabBoard = () => {
onClose();
updateBlockAttributes( clientId, {
showCommentBoard: true,
Copy link
Member

Choose a reason for hiding this comment

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

This sort of state should not live in block attributes.

} );
openGeneralSidebar( 'edit-post/collab-sidebar' );
};

return (
<MenuItem
icon={ collabComment }
onClick={ openCollabBoard }
aria-haspopup="dialog"
>
{ __( 'Add Comment' ) }
</MenuItem>
);
}
Loading