desktop: size the variant flyout from the label, not a fixed 160px

Đang mở Phù hợp với người mới
#62,981 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
desktop

Hướng nghiên cứu

Đọc packages/app/src/providers/models/select-dialog-machine.ts và packages/app/src/providers/models/select-dialog.css để theo dõi chiều rộng và vị trí của flyout, sau đó kiểm tra packages/ui/src/navigation/menu/menu.css để xem chiều cao hàng và khoảng cách dòng. Điều chỉnh chiều rộng flyout theo nhãn của nó và đảm bảo các dòng bị ngắt có đủ chỗ; hoàn thành khi nhãn dài vừa khít, nhãn ngắn vẫn hẹp và vị trí sử dụng chiều rộng đã đo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

reproduced
Description

The model picker's variant flyout is always 160px wide. FLYOUT_WIDTH_PX in packages/app/src/providers/models/select-dialog-machine.ts is 160, and [data-slot="model-dialog-flyout"] in packages/app/src/providers/models/select-dialog.css sets width: 160px ("One width for every model, matching the 160px its placement assumes"). Labels such as "No Thinking Medium" do not fit that box.

Size the flyout from the label instead of a hardcoded 160px: a fixed number of pixels per character, so a short label stays narrow and a longer one grows. placeFlyout already positions the menu from FLYOUT_WIDTH_PX, so that measured width should drive placement too.

A menu row is height: 28px with line-height: var(--line-height-compact) (packages/ui/src/navigation/menu/menu.css). When a label wraps onto a second line, the characters of the two lines sit on top of each other. Wrapped lines need space between them.

Plugins

cursor-opencode-provider

OpenCode version

Desktop 2.2.6

Steps to reproduce
  1. Open the desktop model picker.
  2. Hover a model whose variants are phrases, for example "No Thinking Medium".
  3. Read the flyout beside the row.
Screenshot

Variant flyout with long labels

Operating System

macOS (Darwin 24.6.0, arm64)

Terminal

Desktop app

Ngôn ngữ chính
TypeScript
Star
225k
Fork
30.4k
Merge trung bình
4 giờ 7 phút
Pull request đã merge (30 ngày)
554

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của anomalyco/opencode

Tất cả issue của anomalyco/opencode

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.