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

Feedbacks for builders #9110

Merged
merged 16 commits into from
Dec 10, 2024
Merged

Feedbacks for builders #9110

merged 16 commits into from
Dec 10, 2024

Conversation

albandum
Copy link
Contributor

@albandum albandum commented Dec 4, 2024

Description

  • Showing feedbacks for builders
  • Co-PR with @overmode

Risk

Deploy Plan

@albandum albandum marked this pull request as draft December 4, 2024 10:22
Copy link

github-actions bot commented Dec 6, 2024

Fails
🚫

Files in **/models/ have been modified. Addition and deletion should be in 2 separate PRs:

  1. Addition: migrate and deploy
  2. Deletion: deploy and migrate

Please add the migration-ack label to acknowledge that a migration will be needed once merged into 'main'.

🚫 Please include a detailed Deploy Plan section in your PR description.

Generated by 🚫 dangerJS against f49ef7c

Copy link
Contributor Author

@albandum albandum left a comment

Choose a reason for hiding this comment

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

Almost there, few comments! (and one or 2 on my own commits haha)

);

const TabsSection = () => (
<Tabs defaultValue="feedback">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's put back "info"

@@ -242,6 +243,32 @@ export function useAgentConfiguration({
};
}

export function useAgentConfigurationFeedbacks({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want any kind of pagination there or do we think it's not worth it for now?
(I think we can wait until someone tells us it's hard to manage)

Copy link
Contributor

Choose a reason for hiding this comment

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

As seen irl the assistant with most feedbacks has only 9 feedbacks, we'll revamp this part when we reach e.g. 100

<div className="mt-3 text-sm text-element-900">No feedbacks.</div>
) : (
<div className="mt-3">
<ConfigVersionHeader
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's not use weird shortcuts names we don't use anywhere -> AgentConfigurationVersionHeader

}) {
const getStringRepresentation = useCallback(
(config: LightAgentConfigurationType) => {
const dateFormatter = new Intl.DateTimeFormat(navigator.language, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't use that anywhere else 🤔
Can we use what we have in the codebase? (also we don't want to format per navigator language, our platform is english only)

return date.toLocaleDateString("en-US", {
      year: "numeric",
      month: "long",
      day: "numeric",
    });

agentConfiguration: LightAgentConfigurationType | undefined;
isLatestVersion: boolean;
}) {
const getStringRepresentation = useCallback(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

getAgentConfigurationVersionString or something like similar.
The goal of being precise is to make sure in the future newcomers don't get confused trying to use one of these specific functions with generic names for something else 👍

Comment on lines 299 to 303
const baseUrl =
process.env.NODE_ENV === "development"
? "http://localhost:3000"
: "https://dust.tt";
const conversationUrl = `${baseUrl}/w/${owner.sId}/assistant/${conversationId}`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
const baseUrl =
process.env.NODE_ENV === "development"
? "http://localhost:3000"
: "https://dust.tt";
const conversationUrl = `${baseUrl}/w/${owner.sId}/assistant/${conversationId}`;
const conversationUrl = `${DUST_FRONT_API}/w/${owner.sId}/assistant/${conversationId}`;

workspaceId: owner.sId,
feedbackId: feedback.id.toString(),
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Import DUST_FRONT_API at the top of your script:

const { DUST_FRONT_API } = process.env;

<ContentMessage variant="slate" className="my-2">
<div className="justify-content-around mb-3 flex items-center gap-2">
<div className="flex w-full items-center gap-2">
<Avatar
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Image will break if userDetails.image === null, display it conditionally 👍 (my fault haha)

include: [
{
model: Message,
as: "agentMessage",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as: "message" no?
It's a bit confusing to name is agentMessage when it's coming from the "Message" model.
Also little snake_case vs camelCase issue

Copy link
Contributor

Choose a reason for hiding this comment

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

I tried a more friendly name but sequelize would complain because the alias is not what is expected (it seems to expect agentMessage specifically). Haven't looked for a workaround for more than 10 minutes though, so happy to jumb back to it if you think it's worth it :)

<Tabs defaultValue="feedback">
<TabsList>
<TabsTrigger value="info" label="Info" icon={InformationCircleIcon} />
<TabsTrigger value="feedback" label="Feedback" icon={HandThumbUpIcon} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
<TabsTrigger value="feedback" label="Feedback" icon={HandThumbUpIcon} />
<TabsTrigger value="feedback" label="Performance" icon={HandThumbUpIcon} />

@overmode overmode requested review from overmode and removed request for overmode December 9, 2024 11:28
<div className="flex w-full items-center gap-2">
<Avatar
size="xs"
visual={userDetails?.image || undefined}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

nit: was more thinking something around

{userDetails.image ? (<Avatar... />) : null

@albandum albandum marked this pull request as ready for review December 9, 2024 12:29
@albandum
Copy link
Contributor Author

albandum commented Dec 9, 2024

LGTM

@overmode overmode self-requested a review December 10, 2024 10:52
@overmode overmode merged commit f726c72 into main Dec 10, 2024
3 of 4 checks passed
@overmode overmode deleted the alban/feedbacks-builder-ui-sparkle branch December 10, 2024 10:54
overmode added a commit that referenced this pull request Dec 10, 2024
overmode added a commit that referenced this pull request Dec 10, 2024
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