Skip to content

[minor] New Message Input component implementation - #2504

Open
PelayoFelgueroso wants to merge 30 commits into
masterfrom
PelayoFelgueroso/message-input
Open

[minor] New Message Input component implementation#2504
PelayoFelgueroso wants to merge 30 commits into
masterfrom
PelayoFelgueroso/message-input

Conversation

@PelayoFelgueroso

Copy link
Copy Markdown
Collaborator

Checklist
(Check off all the items before submitting)

  • Build process is done without errors. All tests pass in the /lib directory.
  • Self-reviewed the code before submitting.
  • Meets accessibility standards.
  • Added/updated documentation to /website as needed.
  • Added/updated tests as needed.

Purpose
Implemente the new message input component based on the design.

Comment thread packages/lib/src/message-input/MessageInput.tsx Outdated
Comment thread packages/lib/src/message-input/MessageInput.tsx Outdated
Comment thread packages/lib/src/message-input/MessageInput.tsx Outdated
Comment thread packages/lib/src/message-input/MessageInput.tsx Outdated
Comment thread packages/lib/src/message-input/MessageInput.tsx Outdated
Comment thread packages/lib/src/select/utils.ts Outdated
Comment thread packages/lib/src/message-input/MessageInput.stories.tsx
Comment thread packages/lib/src/message-input/MessageInput.test.tsx
Comment thread packages/lib/src/message-input/types.ts Outdated
Comment thread packages/lib/src/message-input/useVoiceTranscription.tsx Outdated
`;

const TranscriptOverlay = styled.div`
position: absolute;

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.

If you keep talking and allowing the transcript to grow it covers the stop button, which does not allow the user to stop the transcript. It also affects the scrollbar behavior.

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.

fixed

padding: var(--spacing-padding-m) var(--spacing-padding-xs);
background-color: var(--color-bg-neutral-lightest);
box-shadow: 0 -24px 10px 4px rgba(255, 255, 255, 0.6);
${({ disabled, error, focus }) => inputStylesByStatePromptInput(disabled, error, focus)}

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 function injects a different background color than the one defined a few lines above.

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.

fixed

`;

const FilesContainer = styled.div`
min-height: 32px;

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 should not be needed since the trigger is already 32 px

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.

removed

width: ${({ size = "medium" }) => sizes[size]};
display: flex;
flex-direction: column;
gap: var(--spacing-gap-xs);

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 gap is unnecessary, the error message does already have 4px of separation.

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.

removed


border-radius: var(--border-radius-l);

border: ${!disabled && error ? "var(--border-width-m)" : "var(--border-width-s)"} var(--border-style-default)

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.

in disabled state it does have a different bordero color

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.

fixed

<DxcMessageInput placeholder="Ask me anything..." error="Error Message" />
</ExampleContainer>

<Title title="Validation" theme="light" level={2} />

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.

These two do not really make sense as visual tests

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.

removed

onClick={handleInputContainerOnClick}
onMouseDown={handleInputContainerOnMouseDown}
>
{files && typeof callbackFile === "function" && (

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.

Thinking about it even if it is controlled, users can define files as undefined first.

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.

fixed

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.

I would add an explanation on how to enable files in the 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.

done

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.

2 participants