Skip to content

[#69706] show WP link input only for current user and remove on blur#105

Merged
ihordubas99 merged 6 commits intodevfrom
bug/69706-search-input-user-visiblity
Mar 4, 2026
Merged

[#69706] show WP link input only for current user and remove on blur#105
ihordubas99 merged 6 commits intodevfrom
bug/69706-search-input-user-visiblity

Conversation

@ihordubas99
Copy link
Copy Markdown
Collaborator

@ihordubas99 ihordubas99 commented Feb 19, 2026

https://community.openproject.org/projects/communicator-stream/work_packages/69706/activity

Restrict WP link input visibility to the user creating the block by tracking active state, remove uninitialized blocks on input blur, reset dropdown and focus state, ensure keyboard navigation works correctly.

@ihordubas99 ihordubas99 requested a review from akabiru February 19, 2026 18:01
@ihordubas99 ihordubas99 self-assigned this Feb 19, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 19, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@ihordubas99
Copy link
Copy Markdown
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

@akabiru akabiru requested review from a team and judithroth and removed request for akabiru February 20, 2026 06:51
Copy link
Copy Markdown
Contributor

@judithroth judithroth left a comment

Choose a reason for hiding this comment

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

Removing on blur is working 👍
I also see that you tried to improve and clean up the code - thanks for that!
I have some remarks though that keep me from approving so far (see comments)

Comment thread lib/components/OpenProjectWorkPackageBlock.tsx
Comment thread lib/components/OpenProjectWorkPackageBlock.tsx
Comment thread lib/components/OpenProjectWorkPackageBlock.tsx Outdated
Comment thread lib/components/OpenProjectWorkPackageBlock.tsx
border: none;
border-radius: var(--bn-border-radius-small);
margin: var(--spacer-s) 0;
padding: 0 var(--spacer-m);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder why you changed margin and padding here? Did you want to change something else maybe?

Before it looked like this:

Image

Now it looks like this:

Image

There is also now an additional disabled scroll bar that should not be there.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I’ve reverted the margin and padding changes those were added by mistake.
Regarding the scrollbar, I had added it intentionally at first because I thought it was a UI issue. It’s now gone as well. Thanks for catching that!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing the scrollbar! The additional margin is still there though. I tried to illustrate in the picture what I mean:

Image

Copy link
Copy Markdown
Contributor

@judithroth judithroth left a comment

Choose a reason for hiding this comment

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

Ok, I still found some things that should be changed, but overall this looks quite good so far 👍

border: none;
border-radius: var(--bn-border-radius-small);
margin: var(--spacer-s) 0;
padding: 0 var(--spacer-m);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing the scrollbar! The additional margin is still there though. I tried to illustrate in the picture what I mean:

Image

editor,
}: {
block: BlockProps;
editor: BlockNoteEditor<DefaultBlockSchema & { openProjectWorkPackage: ReturnType<typeof openprojectWorkPackageBlockConfig> }>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was it necessary to change the type of the editor? I remember BlockNote to sometimes be picky when not the correct type was used, although now it seems to work with <any>. I'm just wondering 😅

Copy link
Copy Markdown
Collaborator Author

@ihordubas99 ihordubas99 Feb 27, 2026

Choose a reason for hiding this comment

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

I used <any> during development to avoid typing errors. Now I've changed everything back to the correct type, thanks!

Comment thread lib/components/OpenProjectWorkPackageBlock.tsx
(editor: BlockNoteEditor<any>) => ({
title: i18n.t("slashMenu.title"),
onItemClick: () => {
const insertedBlock = insertOrUpdateBlockForSlashMenu(editor, {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be possible to wrap all this that should happen in onItemClick in a function?
So far openProjectWorkPackageSlashMenu was readable quite nice. Having all that code in here somehow makes it hard to see what the actual keys and values are for this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! I moved the click logic into a separate function handleOpenProjectWorkPackageClick to keep onItemClick clean and readable

tabIndex={disableFocus ? -1 : 0} // tabIndex toggle could affect accessibility
style={disableFocus ? { pointerEvents: "none" } : undefined}
>
<div contentEditable={false}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this the thing that prevents the deletion through an other user? If that's all that is needed it would be really nice 👍

Copy link
Copy Markdown
Contributor

@judithroth judithroth left a comment

Choose a reason for hiding this comment

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

This looks good now 👍

@ihordubas99 ihordubas99 merged commit f29932d into dev Mar 4, 2026
5 checks passed
@ihordubas99 ihordubas99 deleted the bug/69706-search-input-user-visiblity branch March 4, 2026 09:48
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants