Skip to content
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

Merged
merged 7 commits into from
Apr 29, 2024

Conversation

liamcho
Copy link
Contributor

@liamcho liamcho commented Apr 24, 2024

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

@liamcho liamcho self-assigned this Apr 24, 2024
@liamcho liamcho force-pushed the feat/AC-2098-display-file-message branch from a2d5501 to cbac2aa Compare April 25, 2024 05:54
src/utils/index.ts Outdated Show resolved Hide resolved
return <div>{<AdminMessage message={message} />}</div>;
}

if (isFormMessage(message)) {
const forms = message.extendedMessagePayload.forms;
const forms: Form[] = message.extendedMessagePayload!.forms as Form[];
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Contributor

@bang9 bang9 Apr 25, 2024

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

Copy link
Contributor

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[])

@liamcho liamcho requested a review from AhyoungRyu April 25, 2024 09:09
src/utils/messages.ts Outdated Show resolved Hide resolved
Comment on lines 8 to 15
const Root = styled.div`
width: 100%;
`;

const Image = styled.img`
border-radius: 16px;
width: 100%;
`;
Copy link
Contributor

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?

Copy link
Contributor Author

@liamcho liamcho Apr 26, 2024

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bang9 bang9 force-pushed the feat/AC-2098-display-file-message branch from 9dd361e to dc12620 Compare April 26, 2024 04:31
@liamcho liamcho requested a review from bang9 April 26, 2024 04:54
@AhyoungRyu
Copy link
Collaborator

AhyoungRyu commented Apr 26, 2024

From the video you attached, I just saw this is being rendering in the image viewer message. Please make sure this is not being rendered before you merge :)

Screenshot 2024-04-26 at 6 10 30 PM

Note: empty message above is expected (empty user message was sent before file message)

Oh probably this is what you mentioned.

@liamcho liamcho merged commit 4d03e58 into develop Apr 29, 2024
@liamcho liamcho deleted the feat/AC-2098-display-file-message branch April 29, 2024 01:04
@liamcho liamcho added the v1.4.5 label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants