Skip to content

Added free keyword text area#694

Open
SonAndrea wants to merge 3 commits into
mainfrom
652-free-text-keywords
Open

Added free keyword text area#694
SonAndrea wants to merge 3 commits into
mainfrom
652-free-text-keywords

Conversation

@SonAndrea

@SonAndrea SonAndrea commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator

Allows for users to input a maximum of 40 characters for a keyword when editing meta data. Additionally, kept the selector for preexisting keywords for easy of use.

@SonAndrea SonAndrea linked an issue Mar 31, 2026 that may be closed by this pull request
@netlify

netlify Bot commented Mar 31, 2026

Copy link
Copy Markdown

Deploy Preview for dailp ready!

Name Link
🔨 Latest commit 815def9
🔍 Latest deploy log https://app.netlify.com/projects/dailp/deploys/6a20b75bd604fa00080cdb6e
😎 Deploy Preview https://deploy-preview-694--dailp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@SonAndrea SonAndrea linked an issue Mar 31, 2026 that may be closed by this pull request
@chullings chullings requested a review from alisony755 April 15, 2026 19:09
alisony755
alisony755 previously approved these changes Apr 28, 2026

@alisony755 alisony755 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks good and works well! I like the option to add either an existing keyword or a custom one.

onRemove?: (index: number) => void
addButtonLabel: string
customForm?: React.ReactNode
children?: React.ReactNode

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It might be helpful to be slightly more clear about the purpose of children, either with a comment or renaming it to something like freeInput.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Or additionalForm like you use for subject headings

@alisony755 alisony755 dismissed their stale review April 28, 2026 21:10

I'm not sure if they're supposed to, but the keyword changes (as well as the changes to the other metadata fields) don't persist after the modal is submitted?

@alisony755 alisony755 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry my previous comments were not accurate! I was not logged in with an editor account, which is why editing wasn't working. I tested it again and the free text entry for keywords works well!

@GracefulLemming GracefulLemming left a comment

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.

No blocking comments here, just some food for thought.

value={freeKeyword}
onChange={(e) => setFreeKeyword(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter" && freeKeyword.trim()) {

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 like this shortcut, but it does have overlap with the submit button which may be disorienting for users. You don't need to change this PR but I think the solution could involve the submit button only working on focus (assuming that solution doesn't run us astray of accessibility compliance).

@chullings and @jae-mess we should think more about keyboard use across the site

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 removed the shortcut as while nice, I didn't see that conflict and think that it is best to leave it up to site-wide decisions (especially since the other fields don't have it).

/>
addButtonLabel="Add Pre-existing Keywords"
>
{isEditing && (

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.

@chullings are there any metadata fields that shouldn't allow extension from editors?

If we can tolerate all metadata fields drawing from user-built dictionaries like keywords does here, then I think we can move the responsibilities within this block into the TagSelector component

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.

You're technically right. At the time of writing this code, I believe that contributors were allowed to edit metadata but only editors were allowed to add new keywords. This check is redundant now since only editors can write into metadata.

addButtonLabel="Add Pre-existing Keywords"
>
{isEditing && (
<div

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.

Do we need two input fields?

"Add Keyword" and "Select Pre-existing Keyword" both interface with a dictionary of keywords (stored in the keyword table). Why not collapse these fields like we do with word parts?

So, when a user types into the input field, they receive hints pulled from the dictionary (using a substring match). A user can add an existing keyword to a document's metadata by selecting a keyword from the hint list or typing out a keyword in full that is already present in the dictionary. A user can add a keyword that is not in the dictionary by typing it in full before pressing "Add Keyword" (or pressing enter in this case); In this case, the keyword would be added to both the document metadata and the dictionary.

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.

As for this pr, I think this is fine by the specs. In the future I believe all fields will work as you've just described as I've done this with later work for the subject headings.

@SonAndrea SonAndrea requested a review from GracefulLemming June 3, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spatial Coverage Free Text Inputs Free text keywords

3 participants