-
Notifications
You must be signed in to change notification settings - Fork 10
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
Adds TagsSelect component to Predict component #59
Conversation
…re are <2 unselected options
…uestionSuggestionButton
…n line with Question component
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -447,11 +488,6 @@ export function Predict({ | |||
)} | |||
</Transition> | |||
</div> | |||
{tagsPreview?.length > 0 && ( |
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.
Not really sure what this code was doing before, as it doesn't look like tagsPreview
was ever getting updated
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.
This was for if you used a hashtag in the question title to quick-add a tag. Probably we should remove that functionality as it is superseded by this select
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.
Looks lovely in general! A few minor changes and most notably we should remove the existing #hashtag functionality before shipping this I think.
components/predict-form/Predict.tsx
Outdated
@@ -359,6 +359,10 @@ export function Predict({ | |||
} | |||
} | |||
|
|||
// used to calculate width of TagsSelect menu | |||
const containerRef = useRef<HTMLDivElement>(null); |
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.
nit: ;
should be removed by prettier
I use this as my cursor "Rules for AI", and find it doesn't generate semicolons: Always use typescript, React, Tailwind, daisy-ui, clsx, HeroIcons, and TRPC. No semicolons. Prefer useState to React.useState. Use typed reducers (inline type). Prefer inline function props.
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.
Thanks, clearly I also have my format on save setup wrong, I'll fix both
: "opacity-80", | ||
small && "btn-xs px-5", | ||
"w-full resize-none rounded-md p-4 -mb-2 border-b bg-white", | ||
"focus:outline-indigo-700 placeholder:text-neutral-400", |
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.
ref={mergeRefs([textAreaRef, formRef])} | ||
/> | ||
<div className="flex flex-row items-center p-2 sm:px-4 gap-1 z-20"> | ||
<TagsSelect |
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.
@@ -447,11 +488,6 @@ export function Predict({ | |||
)} | |||
</Transition> | |||
</div> | |||
{tagsPreview?.length > 0 && ( |
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.
This was for if you used a hashtag in the question title to quick-add a tag. Probably we should remove that functionality as it is superseded by this select
@@ -109,6 +119,84 @@ export function TagsSelect({ | |||
// 2px box shadow |
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.
We could improve this by using the classNames
prop instead of styles
, so we can use tailwind styles and keep it consistent with the rest of our styles. Notably could use max-sm
instead of doing manual media breakpoints. Probably not worth switching costs unless Claude can ~one-shot it! https://react-select.com/styles#the-classnames-prop
…t component, updates TagsSelect component to only use a single column menuList during tag creation
bug: When I submit a prediction, keep the tags and submit another, the tags stay visually in the select but aren't applied to the second prediction
|
Pull Request: Adds TagsSelect to Predict component
Related Issue
Asana ref
Changes Made
Testing
Tested locally and in preview, for TagsSelect components in Predict, Question and Calibration components.