Repository navigation
fix(web): name cut-off model picker labels in full on hover #29140
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
Changes from all commits
285697d
c6f735c
6529fb0
bb2c038
4039839
3b3d460
c5b2696
ce1058d
095196f
8cd418b
38ad2f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,7 +84,10 @@ function lockBackgroundScroll(popup: HTMLElement | null) { | |
| } | ||
|
|
||
| /** What a docked effort column needs from its picker: the model it serves. */ | ||
| export const DockedPickerContext = createContext<{ modelLabel: string }>({ modelLabel: "" }); | ||
| export const DockedPickerContext = createContext<{ modelLabel: string; modelName: string }>({ | ||
| modelLabel: "", | ||
| modelName: "", | ||
| }); | ||
|
|
||
| export const ProviderModelPicker = memo(function ProviderModelPicker(props: { | ||
| environmentId: EnvironmentId | null; | ||
|
|
@@ -457,7 +460,7 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: { | |
| touchBackdrop | ||
| > | ||
| {props.effortColumn ? ( | ||
| <DockedPickerContext value={{ modelLabel: triggerTitle }}> | ||
| <DockedPickerContext value={{ modelLabel: triggerTitle, modelName: triggerLabel }}> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve the full model name in the header title.
|
||
| <div className="flex max-h-(--available-height) flex-col"> | ||
| {/* One fixed height, so a model with more options never resizes the popup. Short | ||
| windows shrink it and keep the footer. */} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import type { PointerEvent } from "react"; | ||
|
|
||
| /** A pointer-enter handler that titles the element with `title` only while it or a child is cut off. */ | ||
| export function titleWhenClipped(title: string) { | ||
| return (event: PointerEvent<HTMLElement>) => { | ||
| const element = event.currentTarget; | ||
| const clipped = [element, ...element.children].some( | ||
| (node) => node.scrollWidth > node.clientWidth, | ||
| ); | ||
| element.title = clipped ? title : ""; | ||
| }; | ||
| } |
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.
Assert the next model’s full title.
This assertion passes when the new header has no title. It therefore does not verify that the full name remains available while the pointer rests over the header. Assert
"Claude Sonnet 5.5 Long Context"throughvi.waitForinstead.As per coding guidelines, “Browser tests assert through
expect.elementorvi.waitFor.” The path instructions also require tests to check behavior that can break.Sources: Coding guidelines, Path instructions