Skip to content

feat(backend): add visibility toggle for backend versions in deployment dropdown - #1302

Draft
yxf0314 wants to merge 1 commit into
gpustack:mainfrom
yxf0314:issue/5149-hide-backends-versions-ui
Draft

feat(backend): add visibility toggle for backend versions in deployment dropdown#1302
yxf0314 wants to merge 1 commit into
gpustack:mainfrom
yxf0314:issue/5149-hide-backends-versions-ui

Conversation

@yxf0314

@yxf0314 yxf0314 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings July 24, 2026 01:30
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds UI controls to hide/show inference backends and specific backend versions so they can be removed from the deployment “backend version” dropdown without deleting the backend/version (issue #5149).

Changes:

  • Add enable/disable actions on backend rows to toggle backend visibility in the deploy dropdown.
  • Add per-version visibility Switch in the versions modal, persisted via disabled_versions on the backend.
  • Add i18n strings for the new visibility labels/tooltips.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/pages/backends/index.tsx Adds enable/disable action handling and refresh wiring for the version modal.
src/pages/backends/forms/version-info.tsx Adds per-version visibility Switch UI and passes visibility state into version rows.
src/pages/backends/config/types.ts Extends backend form/type shape with disabled_versions.
src/pages/backends/config/index.ts Re-enables and scopes backend enable/disable actions in the actions list.
src/pages/backends/components/version-info-modal.tsx Persists version visibility via disabled_versions updates and notifies parent to refresh.
src/locales/zh-CN/backends.ts Adds new locale keys for version visibility labels/tooltips.
src/locales/tr-TR/backends.ts Adds new locale keys for version visibility labels/tooltips.
src/locales/ru-RU/backends.ts Adds new locale keys for version visibility labels/tooltips.
src/locales/ja-JP/backends.ts Adds new locale keys for version visibility labels/tooltips.
src/locales/en-US/backends.ts Adds new locale keys for version visibility labels/tooltips.
Comments suppressed due to low confidence (1)

src/pages/backends/forms/version-info.tsx:273

  • Using the array index as the React key can cause items to be reused incorrectly when the list is filtered/reordered (especially now that each row contains a controlled Switch). Prefer a stable key like version_no.
          dataList.map((version: VersionListItem, index: number) => {
            return (
              <VersionItem
                key={index}
                data={version}
                hidden={disabledVersions.includes(version.version_no as string)}
                onToggleVisibility={onToggleVisibility}
              />

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +184 to +188
// ================ Enable / Disable ================
if (item.action === 'enable' || item.action === 'disable') {
handleToggleEnabled(item);
return;
}
Comment on lines +164 to +175
await handleEnableBackend({
id: item.data.id,
data: {
...item.data,
enabled: item.action === 'enable'
},
showMessage: true
});
await new Promise((resolve) => {
setTimeout(resolve, 300);
});
handleSearch();
Comment on lines +33 to +47
const handleToggleVisibility = async (versionNo: string, hidden: boolean) => {
const next = hidden
? [...disabledVersions, versionNo]
: disabledVersions.filter((v) => v !== versionNo);
try {
await updateBackend(currentData.id, {
data: { ...currentData, disabled_versions: next }
});
setDisabledVersions(next);
message.success(intl.formatMessage({ id: 'common.message.success' }));
onChanged?.();
} catch (error) {
// request layer surfaces the error message
}
};
Comment on lines +217 to 224
const VersionList: React.FC<{
versionConfigs: VersionListItem[];
disabledVersions?: string[];
onToggleVisibility?: (versionNo: string, hidden: boolean) => void;
}> = ({ versionConfigs, disabledVersions = [], onToggleVisibility }) => {
const intl = useIntl();
const [dataList, setDataList] = useState<VersionListItem[]>(versionConfigs);

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