Simplify subscription profile management UI
Build and Deploy Gateway / build-and-push (push) Successful in 19s
Build and Deploy Gateway / deploy (push) Successful in 7s

This commit is contained in:
2026-08-11 07:36:44 +03:00
parent af1c45e424
commit 5cad3e9061
12 changed files with 148 additions and 251 deletions
@@ -33,10 +33,10 @@ test('App owns profile mutations and always uses the latest canonical revision',
assert.equal((app.match(/revisionRef\.current = snapshot\.revision/g) || []).length, 2);
assert.doesNotMatch(app, /if \(state\) revisionRef\.current = state\.revision/);
assert.match(app, /api\.profiles\.add\(label, url, revisionRef\.current\)/);
assert.match(app, /api\.profiles\.rename\(profileId, label, revisionRef\.current\)/);
assert.match(app, /api\.profiles\.refresh\(profileId, revisionRef\.current\)/);
assert.match(app, /api\.profiles\.forget\(profileId, mode, revisionRef\.current\)/);
assert.match(page, /profiles,[\s\S]*onAdd: onAddProfile,[\s\S]*onRename: onRenameProfile,[\s\S]*onRefresh: onRefreshProfile,[\s\S]*onForget: onForgetProfile/);
assert.match(page, /profiles,[\s\S]*onAdd: onAddProfile,[\s\S]*onRefresh: onRefreshProfile,[\s\S]*onForget: onForgetProfile/);
assert.doesNotMatch(page, /onRenameProfile/);
assert.doesNotMatch(feature, /from ['"][^'"]*\/api\/|\bapi\./);
assert.doesNotMatch(feature, /<ServerPicker|<InlineError|<InlineProgress|<ConnectionPanel|<DevicesPanel|<DiagnosticsPanel/);
});
@@ -52,8 +52,8 @@ test('local validation, scoped refresh and drawer focus remain feature-owned', (
assert.match(feature, /if \(deleteIdRef\.current\) return;[\s\S]*toggleRef\.current\?\.focus\(\)/);
assert.match(feature, /setAdding\(false\)[\s\S]*client-profile-add-trigger'\)\?\.focus\(\)/);
assert.doesNotMatch(feature, /addInvokerRef/);
assert.match(feature, /function cancelRename\(\)[\s\S]*client-profile-menu-\$\{profileId\}[\s\S]*\.focus\(\)/);
assert.match(feature, /id=\{`client-profile-menu-\$\{profile\.id\}`\}/);
assert.match(feature, /className="client-profile-delete"[\s\S]*client-profile-delete-lid/);
assert.doesNotMatch(feature, /cancelRename|client-profile-menu|onRename/);
});
test('validation rejection parser preserves structured errors and normalizes non-objects', () => {
@@ -85,7 +85,7 @@ test('validation rejection parser preserves structured errors and normalizes non
});
test('feature keeps exact slots, truthy closes and subscription DOM order', () => {
assert.match(feature, /if \(!await onAdd\(normalizedLabel, normalizedUrl\)\) return;[\s\S]*resetAdd\(\)/);
assert.match(feature, /const host = new URL\(normalizedUrl\)\.hostname;[\s\S]*if \(!await onAdd\(label, normalizedUrl\)\) return;[\s\S]*resetAdd\(\)/);
assert.match(feature, /if \(!await onForget\(deleteProfile\.id, deleteStopsVpn \? 'stop-and-delete' : 'delete'\)\) return;[\s\S]*setDeleteId\(''\)/);
assert.match(feature, /client-profiles-operation[\s\S]*\{statusSlot\}[\s\S]*client-profile-list[\s\S]*feature\.adding[\s\S]*AddProfileForm[\s\S]*client-profile-add-trigger/);
assert.doesNotMatch(feature, /client-profiles-current|aria-label="Добавить подписку"/);
@@ -106,6 +106,9 @@ test('profiles render as flat accordion groups with scoped controls', () => {
assert.match(feature, /!expanded && visibleServer && <button[\s\S]*client-profile-selected-server/);
assert.match(feature, /const visibleServerId = applied \? feature\.selection\.appliedServerId : profile\.desiredServerId/);
assert.match(feature, /const desired = !feature\.connected[\s\S]*&& !feature\.gatewayDirect/);
assert.match(feature, /const profileDomain = subscriptionDomain\(profile\.subscription\.host\)/);
assert.match(feature, /const profileDetails = `Серверов: \$\{profile\.servers\.length\}/);
assert.doesNotMatch(feature, /<strong>\{profile\.label\}<\/strong>|Переименовать|client-profile-menu/);
assert.match(styles, /\.client-profile-group/);
assert.match(styles, /\.client-profile-body/);
assert.match(styles, /\.client-profile-refresh\.is-refreshing/);