Repository navigation
Conversation
voidmatcha
left a comment
There was a problem hiding this comment.
Thanks. I went through the Storybook stories (Empty, Draft, WhitespaceOnly, Sending, ReadOnly, Playground) in both themes, and the guards, trimming, and read-only/sending states are implemented as described. Two small things below; the changes are on my branch: voidmatcha/zeppelin@9f25deb...ZEPPELIN-6746-pr5569-review-fixes
Please take whatever you find useful.
Minor, not blocking: the placeholder text ("Ask about this notebook") uses antd's default color, whose contrast against the background is about 1.8:1 in light and 2.3:1 in dark, below the 4.5:1 WCAG AA minimum for normal text. Could be a follow-up.
|
Thanks for the review and for the fixes. I took all three:
|
voidmatcha
left a comment
There was a problem hiding this comment.
I confirmed the suggested changes are all in (Safari IME, the value test, and placeholder contrast).
LGTM 👍 Once the prerequisite PRs merge, I will retarget this PR to master and check the final diff and CI before merging.
|
@kimyenac #5562 is on It rebases without conflicts and the tests pass. Please also drop the "Blocked by" line from the description. |
What is this PR for?
Add the AI Assistant question composer: a controlled component that takes a value, change and submit callbacks, and read-only and sending states. Nothing is sent anywhere. The parent receives the question and decides what to do with it. The component lives in
projects/zeppelin-react/src/entities/assistant/ui.Base:
branch-voidmatcha-assistant-storybook-temp(branched at4599ad2d9). This PR adds only the commits below, as four new files. The base already contains the prerequisite PRs: ZEPPELIN-6740 (#5562, Storybook) and ZEPPELIN-6743 (#5565). Once those merge, the base goes back tomaster.Commits:
AssistantComposeris a<form>with an antdInput.TextArea(auto-sizing, 2–8 rows) and a SendButton.onSubmitreceives the question with surrounding whitespace trimmed. Clearing the input afterwards is left to the parent, so it can keep the text if sending fails.readOnlyis set (for example a conversation owned by another user). The textarea is disabled and a note explains why (readOnlyReason, with a default).sendingis set (the server accepts one run per conversation). The textarea becomes read-only, so the question stays visible, and the button shows a spinner.Assistant/Composer: Empty, Draft, WhitespaceOnly, Sending, ReadOnly.Assistant/Composer/Playgroundkeeps its own value: type, send with the button or Enter, seeonSubmitin the Actions panel and the input cleared.compositionendbefore that Enter, so it arrives withisComposing: falseandkeyCode: 229. The check now covers both.onChangeis ignored, and shows and sends a value the parent sets later. Both tests fail ifvaluebecomesdefaultValue.textTertiary, which the theme lifts to 4.5:1. Measured in Storybook: 6.10:1 / 6.39:1 on the panel, 5.84:1 on the read-only field.Styling uses
@vanilla-extract/cssthrough the Assistant theme contract only. The field draws a single focus ring for the textarea inside it. The HTML/CSS screens invoidmatcha/assistant-storybook-sharewere used as a design reference. The code is written from scratch.Out of scope (per the issue): per-conversation draft persistence, actual sending, Stop and retry. These belong to panel assembly (ZEPPELIN-6748) or follow-up issues.
What type of PR is it?
Feature
Todos
What is the Jira issue?
How should this be tested?
In
zeppelin-web-angular/projects/zeppelin-react:npm ci,npm test(138 passed, 8 new),npm run typecheck,npm run lintandnpm run build:storybookall pass.typecheckneedsnpm ciinzeppelin-web-angularfirst, because the SDK resolvesrxjsfrom there.prettier --check.npm run storybook: every story above checked in both themes, including typing Korean and pressing Enter mid-composition in Playground (Chrome). Safari was not tried; commit 3 is covered by akeyCode: 229unit test.keyCodecheck, the trim, the sending guard, the read-only guard or the read-only textarea while sending, or usingdefaultValue, each fails the intended test.npm run test:storybook -- --workers=1: all 14 tests pass. With the default 3 workers the existingpython3 -m http.serverweb server occasionally drops requests. The base's own story reproduces this, so it is not caused by these stories (see [ZEPPELIN-6745] Add AI Assistant message and answer state UI #5567).Screenshots (if appropriate)
See the
Assistant/Composerstories.Questions: