-
Notifications
You must be signed in to change notification settings - Fork 17
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: Display file message from bot #169
Conversation
a2d5501
to
cbac2aa
Compare
return <div>{<AdminMessage message={message} />}</div>; | ||
} | ||
|
||
if (isFormMessage(message)) { | ||
const forms = message.extendedMessagePayload.forms; | ||
const forms: Form[] = message.extendedMessagePayload!.forms as Form[]; |
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.
Any reason we force type casting here in this way?
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.
because forms is unknown type so forms[0]
complains
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.
Is it different? message.forms
vs message.extendedMessagePayload.forms
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.
maybe now, we can remove assertion (as Form[]
)
src/components/localhost:5173/chat-ai-widget/src/components/CustomMessage.tsx
Outdated
Show resolved
Hide resolved
src/components/FileMessage.tsx
Outdated
const Root = styled.div` | ||
width: 100%; | ||
`; | ||
|
||
const Image = styled.img` | ||
border-radius: 16px; | ||
width: 100%; | ||
`; |
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.
It seems like these simple components don't need to use styled components.
Since styled components are executed at runtime, they need to be executed, and template literals not to be minified, making the code larger.
How about just using inline styles on regular tags?
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.
Since styled components are executed at runtime, they need to be executed, and template literals not to be minified, making the code larger.
Thats a good point. Additionally,I learned that using styled component has no css class identifier which has two crucial cons:
- Hard to locate source code from developer tools.
- Customers cannot override their own style.
I think we should remove styled component later. For the same reason, I want to avoid using inline styling. Also inline styling has high precedence so customer may complain later. How about using scss files just like UIKit?
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.
Agreed. However, the highest priority in the current widget is to improve performance and reduce bundle size.
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.
Later on, it would be good to transition to zero-runtime tools like vanilla extract.
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.
9dd361e
to
dc12620
Compare
feat.2.webm
Note: empty message above is expected (empty user message was sent before file message)
File viewer will be added in the future (currently no design so I left it as comment instead)
수천만원에 엑싯하는 사이드 프로젝트가 한둘이 아니다 (feat. 비즈니스 마켓플레이스).webm