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

Stampy redesign #735

Merged
merged 196 commits into from
Jun 20, 2024
Merged

Stampy redesign #735

merged 196 commits into from
Jun 20, 2024

Conversation

mruwnik
Copy link
Collaborator

@mruwnik mruwnik commented Jun 18, 2024

New chatbot UI deployment.

Testable version at https://redesign.aprillion.workers.dev/chat/

@LeMurphant
Copy link
Collaborator

I can't vouch for the code, but the functionality looks good enough.

The two issues that bug me most are
#736
#643
Still, I think it's ok for a first release.

Aprillion
Aprillion previously approved these changes Jun 19, 2024
Copy link
Collaborator

@Aprillion Aprillion left a comment

Choose a reason for hiding this comment

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

✅ few comments, but I didn't notice anything that should block the release

Copy link
Collaborator

Choose a reason for hiding this comment

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

(minor) why do we have 2 sizes? SVG is supposed to be "scalable" vector graphics...

Copy link
Collaborator

Choose a reason for hiding this comment

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

the extra whitespace after changing viewBox is expected?

.submit {
height: var(--spacing-48);
border-radius: var(--border-radius);
font-weight: 500 !important;
Copy link
Collaborator

Choose a reason for hiding this comment

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

(minor)
a) does important help?
b) do we even use a font that has weight 500? (non-variable fonts usually have 400 = normal, 700 = bold, but not semi/demi-bold variations)

@@ -0,0 +1,293 @@
export const CHATBOT_URL = 'https://chat.stampy.ai:8443/chat'
Copy link
Collaborator

Choose a reason for hiding this comment

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

this shouldn't come from environment variables?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it should. But I gave up after trying various things and nothing working

question?: string
}

export const formatCitations: (text: string) => string = (text) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

the chat-related files are copied from the other repo and already tested, right? we didn't have any automated tests to be copied too, please? 👀

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no tests :/
and also could maybe do with more checking - I found quite an interesting bug there

Comment on lines +166 to +167
// don't ask
setActionTaken(actionTaken)
Copy link
Collaborator

Choose a reason for hiding this comment

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

?!?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@zarSou9 explain yourself! For the allseeing gaze of Peter has fallen upon you!

Copy link
Contributor

Choose a reason for hiding this comment

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

aaaaahhhhh, not the all-seeing gaze!!! I mean I did give some pretty explicit instructions for people not to ask, but here goes anyway. Basically, because react batches state changes when it wants to, actionTaken on line 167 does not see the change of 152 and thus I am setting action taken to its original state before the state change on line 152. Anyway, I've since learned that the correct solution to this is to pass a function to setState, like so: setState((v) => !v). This works for now, but I'll change it next time i'm working on the code :).

Copy link
Collaborator

@Aprillion Aprillion Jun 19, 2024

Choose a reason for hiding this comment

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

I might have seen that problem once or twice... I think the code is fine for that purpose (using (v) => !v could be wrong if the handler is called multiple times), but the comment could improve:

Suggested change
// don't ask
setActionTaken(actionTaken)
// if response is not ok, revert to original state as it was before this handler started
setActionTaken(actionTaken)

Copy link
Collaborator

Choose a reason for hiding this comment

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

why not deleting the file?

Copy link
Collaborator

Choose a reason for hiding this comment

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

another non-deleted file?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we deleted the code to switch between 2 favicons => this file shouldn't be re-added

Copy link
Collaborator

Choose a reason for hiding this comment

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

and this file is not needed either

@bryceerobertson
Copy link
Member

I think #643 is sufficiently problematic to be launch-blocking, since it seems to consistently happen at around the 3rd or 4th prompt. Other than that looks great.

Copy link
Contributor

@zarSou9 zarSou9 left a comment

Choose a reason for hiding this comment

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

Looking great! Especially since #643 is fixed. 🙏 Nemo

....so who's gonna press it?

@bryceerobertson bryceerobertson merged commit 45595cf into master Jun 20, 2024
1 check passed
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.

7 participants