feat(ui): màn quản lý project — chế độ chỉ-xem, chặn trùng tên, menu chuột phải
Bốn thay đổi trên cùng một khối, gom vào presentation/workspace/project_editing.py: - Project đã có mở ra ở dạng CHỈ ĐỌC; phải bấm "Sửa project" (nút vàng) mới gõ được, và nút Lưu chuyển xanh lá. Trước đây form luôn mở nên chỉ cần lỡ tay là sửa mất nội dung của một project đang dùng mà không có gì cảnh báo. - Chặn TRÙNG TÊN khi tạo và khi lưu (không phân biệt hoa thường, bỏ khoảng trắng hai đầu). Danh sách bên trái chỉ hiện tên, nên trùng tên là không phân biệt được nữa. Chặn TRƯỚC khi ghi đĩa. - Chuột phải một project: Mở / Sửa / Xoá. Trước đây bấm phải không làm gì cả. - workspace.counts được format một lần lúc dựng dòng nên đổi ngôn ngữ xong nó vẫn nằm ở ngôn ngữ cũ, kể cả khi chọn tiếng Anh. ProjectRow giờ giữ SỐ và tự format lại — KHÔNG gọi refresh(), vì refresh() kết thúc bằng _load_current() và sẽ xoá mất nội dung người dùng đang gõ dở. Ba nút về chung một hàng với "Project mới", và cùng theo một luật hiện/ẩn: chỉ hiện trên sub-tab Project và khi có project đang mở. Hàng tiêu đề vắt ngang cả màn Workspace nên thứ gì đặt lên đó cũng lọt sang Cowork/Co4E/Thư mục/GraphRAG nếu không tự ẩn. Màu vàng/xanh lá đi qua token warning/success. Hai nút dùng nền *_soft với chữ và viền là token, KHÔNG phải nền đặc: hai token đó được chỉnh làm màu CHỮ (cùng lý do accent và accent_solid là hai token riêng) — chữ trắng trên warning dark #CCA700 chỉ đạt ~2.3:1, trượt AA. ui/workspace_tab.py đang ở đúng trần bánh cóc nên phần mã mới bắt buộc ra module riêng; chuyển _ProjectRow và CRUD sang đó làm file co từ 566 xuống 523 dòng mã, và bánh cóc được siết theo. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
thanhnv
co-authored by
Claude Opus 5
parent
e601225b0f
commit
69ffe8954a
@@ -141,6 +141,25 @@ QPushButton#danger {
|
||||
QPushButton#danger:hover { background: $danger_solid_hover; }
|
||||
QPushButton#danger:disabled { background: $surface; color: $text_disabled; border-color: $border; }
|
||||
|
||||
/* Tinted, not filled. `warning` and `success` are tuned as TEXT colours — the
|
||||
same reason `accent` and `accent_solid` are separate tokens: a hue readable
|
||||
as ink on a surface is too light to carry white as a fill (dark `warning` is
|
||||
#CCA700, which white fails AA against). A soft ground with the token as ink
|
||||
keeps the contrast that was already verified, in both themes. */
|
||||
QPushButton#warning {
|
||||
background: $warning_soft; color: $warning; border: 1px solid $warning; font-weight: 600;
|
||||
}
|
||||
QPushButton#warning:hover { background: $hover; }
|
||||
QPushButton#warning:pressed { background: $active; }
|
||||
QPushButton#warning:disabled { background: $surface; color: $text_disabled; border-color: $border; }
|
||||
|
||||
QPushButton#success {
|
||||
background: $success_soft; color: $success; border: 1px solid $success; font-weight: 600;
|
||||
}
|
||||
QPushButton#success:hover { background: $hover; }
|
||||
QPushButton#success:pressed { background: $active; }
|
||||
QPushButton#success:disabled { background: $surface; color: $text_disabled; border-color: $border; }
|
||||
|
||||
/* Ghost buttons: nav section headers and icon-only chrome. */
|
||||
QPushButton#navMenuBtn {
|
||||
background: transparent; border: none; border-radius: ${radius}px; padding: 5px 6px;
|
||||
@@ -283,6 +302,13 @@ QPushButton#detailCopyBtn:hover { background: rgba(255,255,255,0.25); }
|
||||
|
||||
QLabel { background: transparent; }
|
||||
QLabel#hint { color: $text_muted; }
|
||||
|
||||
/* Panel "dang tai" phu len khung do thi GraphRAG. Dung khung QWebEngineView la
|
||||
viec DONG BO tren GUI thread (~1-2s), nen thanh tien trinh o day khong chay
|
||||
duoc trong giai doan do — panel van phai nhin thay duoc, va do la ly do no co
|
||||
nen dac cua rieng minh thay vi chi la mot dong chu. */
|
||||
QWidget#graphBusy { background: $overlay; border: 1px solid $border_strong; border-radius: ${radius}px; }
|
||||
QWidget#graphBusy QLabel { color: $text; font-weight: 600; }
|
||||
QLabel#faint { color: $text_faint; }
|
||||
QLabel#warning { color: $warning; font-weight: 600; }
|
||||
QLabel#error { color: $danger; font-weight: 600; }
|
||||
|
||||
Reference in New Issue
Block a user