-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat: custom byline interfce #3746
base: trunk
Are you sure you want to change the base?
Conversation
Also adds the return of a function on useEffect to allow React cleanup on unmount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I think this is coming together! The UX of it feels good. I noticed a few quirks in my testing:
- In general it's kind of hard to read once there are a few authors in there:

Not sure if we should reduce the size of the author boxes or how best to handle that. What do you think, @thomasguillot?
- Using the arrow keys, you can go into one of the boxes and then type to modify the content. I think it should not be editable.

- If you select a portion of the text that includes a box and delete, the box doesn't go back into the available authors section:


- Authors are always inserted at the end of the text box. I think the best experience would be for them to be inserted at the cursor position, otherwise it's tricky to edit existing bylines to add/change authors around.
This is starting to look pretty good! Here are two things I noticed:
The idea of storing the ID and the name is to have a fallback in case the user is deleted. When we render the byline, we'll always read the ID and get the Display name from the database, but if the ID is gone, we'll use the name that is stored there. |
Ah, and before you get crazy and go deep in a rabbit role, we DON'T NEED TO SUPPORT Guest Authors |
You're right, this doesn't look good. Let me think about a different approach here. |
Note: The panel should simply be named "Byline", not "Newspack Custom Byline" |
Can we please make sure the style matches Core's FormTokenField Also we can use |
I've just tested on a fresh post and I still have issues with the backspace interaction: custom-byline.movAnother problem I faced while drafting the new post was that the additional authors only became available after I saved and refreshed the post. Ideally, the component would be aware of the edited changes and update the component's available tokens. |
All Submissions:
Changes proposed in this Pull Request:
This Pull Request implements the feature to allow the selection of author tokens from authors selected on Co-Authors Plus to compound a custom byline with them.
How to test the changes in this Pull Request:
div
withcontenteditable
. Below it you should see the authors assigned to the post as buttons that will insert the tokens on the content when clicked.Other information: