From 378742e37a8506460837ff3750d13142d74ef5ce Mon Sep 17 00:00:00 2001 From: zarzet Date: Mon, 13 Apr 2026 04:09:01 +0700 Subject: [PATCH] refactor: remove author field from extension manifest and UI --- go_backend/extension_manager.go | 2 -- go_backend/extension_manifest.go | 5 ----- go_backend/extension_store.go | 6 +----- go_backend/extension_test.go | 3 --- lib/providers/extension_provider.dart | 5 ----- lib/providers/store_provider.dart | 4 ---- lib/screens/repo_tab.dart | 7 ------- lib/screens/settings/extension_detail_page.dart | 5 ----- lib/screens/settings/extensions_page.dart | 2 +- lib/screens/store/extension_details_screen.dart | 6 ------ 10 files changed, 2 insertions(+), 43 deletions(-) diff --git a/go_backend/extension_manager.go b/go_backend/extension_manager.go index 557bdb6..9ff3ecb 100644 --- a/go_backend/extension_manager.go +++ b/go_backend/extension_manager.go @@ -893,7 +893,6 @@ func (m *extensionManager) GetInstalledExtensionsJSON() (string, error) { Name string `json:"name"` DisplayName string `json:"display_name"` Version string `json:"version"` - Author string `json:"author"` Description string `json:"description"` Homepage string `json:"homepage,omitempty"` IconPath string `json:"icon_path,omitempty"` @@ -951,7 +950,6 @@ func (m *extensionManager) GetInstalledExtensionsJSON() (string, error) { Name: ext.Manifest.Name, DisplayName: ext.Manifest.DisplayName, Version: ext.Manifest.Version, - Author: ext.Manifest.Author, Description: ext.Manifest.Description, Homepage: ext.Manifest.Homepage, IconPath: iconPath, diff --git a/go_backend/extension_manifest.go b/go_backend/extension_manifest.go index 6d11aca..fedc431 100644 --- a/go_backend/extension_manifest.go +++ b/go_backend/extension_manifest.go @@ -105,7 +105,6 @@ type ExtensionManifest struct { Name string `json:"name"` DisplayName string `json:"displayName"` Version string `json:"version"` - Author string `json:"author"` Description string `json:"description"` Homepage string `json:"homepage,omitempty"` Icon string `json:"icon,omitempty"` @@ -155,10 +154,6 @@ func (m *ExtensionManifest) Validate() error { return &ManifestValidationError{Field: "version", Message: "version is required"} } - if strings.TrimSpace(m.Author) == "" { - return &ManifestValidationError{Field: "author", Message: "author is required"} - } - if strings.TrimSpace(m.Description) == "" { return &ManifestValidationError{Field: "description", Message: "description is required"} } diff --git a/go_backend/extension_store.go b/go_backend/extension_store.go index be8cce8..4d31a07 100644 --- a/go_backend/extension_store.go +++ b/go_backend/extension_store.go @@ -26,7 +26,6 @@ type storeExtension struct { Name string `json:"name"` DisplayName string `json:"display_name,omitempty"` Version string `json:"version"` - Author string `json:"author"` Description string `json:"description"` DownloadURL string `json:"download_url,omitempty"` IconURL string `json:"icon_url,omitempty"` @@ -83,7 +82,6 @@ type storeExtensionResponse struct { Name string `json:"name"` DisplayName string `json:"display_name"` Version string `json:"version"` - Author string `json:"author"` Description string `json:"description"` DownloadURL string `json:"download_url"` IconURL string `json:"icon_url,omitempty"` @@ -103,7 +101,6 @@ func (e *storeExtension) toResponse() storeExtensionResponse { Name: e.Name, DisplayName: e.getDisplayName(), Version: e.Version, - Author: e.Author, Description: e.Description, DownloadURL: e.getDownloadURL(), IconURL: e.getIconURL(), @@ -497,8 +494,7 @@ func (s *extensionStore) searchExtensions(query string, category string) ([]stor if query != "" { if !containsIgnoreCase(ext.Name, queryLower) && !containsIgnoreCase(ext.DisplayName, queryLower) && - !containsIgnoreCase(ext.Description, queryLower) && - !containsIgnoreCase(ext.Author, queryLower) { + !containsIgnoreCase(ext.Description, queryLower) { found := false for _, tag := range ext.Tags { if containsIgnoreCase(tag, queryLower) { diff --git a/go_backend/extension_test.go b/go_backend/extension_test.go index b0d2b84..c7d7074 100644 --- a/go_backend/extension_test.go +++ b/go_backend/extension_test.go @@ -12,7 +12,6 @@ func TestParseManifest_Valid(t *testing.T) { "name": "test-provider", "displayName": "Test Provider", "version": "1.0.0", - "author": "Test Author", "description": "A test extension", "type": ["metadata_provider"], "permissions": { @@ -46,7 +45,6 @@ func TestParseManifest_Valid(t *testing.T) { func TestParseManifest_MissingName(t *testing.T) { invalidManifest := `{ "version": "1.0.0", - "author": "Test Author", "description": "A test extension", "type": ["metadata_provider"] }` @@ -61,7 +59,6 @@ func TestParseManifest_MissingType(t *testing.T) { invalidManifest := `{ "name": "test-provider", "version": "1.0.0", - "author": "Test Author", "description": "A test extension" }` diff --git a/lib/providers/extension_provider.dart b/lib/providers/extension_provider.dart index 95c392d..93a662b 100644 --- a/lib/providers/extension_provider.dart +++ b/lib/providers/extension_provider.dart @@ -20,7 +20,6 @@ class Extension { final String name; final String displayName; final String version; - final String author; final String description; final bool enabled; final String status; @@ -45,7 +44,6 @@ class Extension { required this.name, required this.displayName, required this.version, - required this.author, required this.description, required this.enabled, required this.status, @@ -73,7 +71,6 @@ class Extension { displayName: json['display_name'] as String? ?? json['name'] as String? ?? '', version: json['version'] as String? ?? '0.0.0', - author: json['author'] as String? ?? 'Unknown', description: json['description'] as String? ?? '', enabled: json['enabled'] as bool? ?? false, status: json['status'] as String? ?? 'loaded', @@ -124,7 +121,6 @@ class Extension { String? name, String? displayName, String? version, - String? author, String? description, bool? enabled, String? status, @@ -149,7 +145,6 @@ class Extension { name: name ?? this.name, displayName: displayName ?? this.displayName, version: version ?? this.version, - author: author ?? this.author, description: description ?? this.description, enabled: enabled ?? this.enabled, status: status ?? this.status, diff --git a/lib/providers/store_provider.dart b/lib/providers/store_provider.dart index ed96e87..b9c9169 100644 --- a/lib/providers/store_provider.dart +++ b/lib/providers/store_provider.dart @@ -63,7 +63,6 @@ class StoreExtension { final String name; final String displayName; final String version; - final String author; final String description; final String downloadUrl; final String? iconUrl; @@ -81,7 +80,6 @@ class StoreExtension { required this.name, required this.displayName, required this.version, - required this.author, required this.description, required this.downloadUrl, this.iconUrl, @@ -102,7 +100,6 @@ class StoreExtension { displayName: json['display_name'] as String? ?? json['name'] as String? ?? '', version: json['version'] as String? ?? '0.0.0', - author: json['author'] as String? ?? 'Unknown', description: json['description'] as String? ?? '', downloadUrl: json['download_url'] as String? ?? '', iconUrl: json['icon_url'] as String?, @@ -194,7 +191,6 @@ class StoreState { e.name.toLowerCase().contains(query) || e.displayName.toLowerCase().contains(query) || e.description.toLowerCase().contains(query) || - e.author.toLowerCase().contains(query) || e.tags.any((t) => t.toLowerCase().contains(query)), ) .toList(); diff --git a/lib/screens/repo_tab.dart b/lib/screens/repo_tab.dart index feadbf5..e8daba8 100644 --- a/lib/screens/repo_tab.dart +++ b/lib/screens/repo_tab.dart @@ -789,13 +789,6 @@ class _ExtensionItem extends StatelessWidget { ), ], ), - const SizedBox(height: 2), - Text( - 'by ${extension.author}', - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: colorScheme.onSurfaceVariant, - ), - ), if (extension.requiresNewerApp) ...[ const SizedBox(height: 4), Container( diff --git a/lib/screens/settings/extension_detail_page.dart b/lib/screens/settings/extension_detail_page.dart index 34abf8c..25b36ba 100644 --- a/lib/screens/settings/extension_detail_page.dart +++ b/lib/screens/settings/extension_detail_page.dart @@ -50,7 +50,6 @@ class _ExtensionDetailPageState extends ConsumerState { name: '', displayName: 'Unknown', version: '0.0.0', - author: 'Unknown', description: '', enabled: false, status: 'error', @@ -206,10 +205,6 @@ class _ExtensionDetailPageState extends ConsumerState { ), ], const SizedBox(height: 16), - _InfoRow( - label: context.l10n.extensionAuthor, - value: extension.author, - ), _InfoRow( label: context.l10n.extensionId, value: extension.id, diff --git a/lib/screens/settings/extensions_page.dart b/lib/screens/settings/extensions_page.dart index 7e3c001..4fc156c 100644 --- a/lib/screens/settings/extensions_page.dart +++ b/lib/screens/settings/extensions_page.dart @@ -425,7 +425,7 @@ class _ExtensionItem extends StatelessWidget { hasError ? extension.errorMessage ?? context.l10n.extensionsErrorLoading - : 'v${extension.version} ${context.l10n.extensionsAuthor(extension.author)}', + : 'v${extension.version}', style: Theme.of(context).textTheme.bodySmall?.copyWith( color: hasError ? colorScheme.error diff --git a/lib/screens/store/extension_details_screen.dart b/lib/screens/store/extension_details_screen.dart index efb2c7e..9af4a7d 100644 --- a/lib/screens/store/extension_details_screen.dart +++ b/lib/screens/store/extension_details_screen.dart @@ -171,12 +171,6 @@ class _ExtensionDetailsScreenState color: colorScheme.onSurface, ), ), - const SizedBox(height: 4), - Text( - context.l10n.extensionsAuthor(ext.author), - style: Theme.of(context).textTheme.bodyLarge - ?.copyWith(color: colorScheme.onSurfaceVariant), - ), ], ), ),