Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:querya_desktop/core/extensions/local_extension_registry.dart';
import 'package:querya_desktop/core/extensions/models/extension_manifest.dart';
import 'package:querya_desktop/core/layout/window_layout.dart';
import 'package:querya_desktop/core/market/marketplace_repository.dart';
import 'package:querya_desktop/core/motion/querya_cross_fade_stack.dart';
import 'package:querya_desktop/features/extensions/presentation/widgets/extension_card.dart';
import 'package:querya_desktop/features/extensions/presentation/widgets/extension_sideload_dialog.dart';
import 'package:querya_desktop/shared/widgets/widgets.dart';
Expand Down Expand Up @@ -214,19 +215,19 @@ class _ExtensionManagerContentState
material.Padding(
padding: const material.EdgeInsets.symmetric(
horizontal: 24.0, vertical: 8.0),
child: material.Wrap(
spacing: 8,
runSpacing: 8,
children: [
_buildTabButton(0, 'Installed', count: _installed.length),
_buildTabButton(1, 'Marketplace'),
_buildTabButton(2, 'Updates'),
child: QueryaTabStrip(
labels: [
'Installed (${_installed.length})',
'Marketplace',
'Updates',
],
selectedIndex: _tabIndex,
onSelected: (index) => setState(() => _tabIndex = index),
),
),
material.Divider(height: 1, color: theme.border),
material.Expanded(
child: material.IndexedStack(
child: QueryaCrossFadeStack(
index: _tabIndex,
children: [
_buildInstalledTab(),
Expand All @@ -243,22 +244,6 @@ class _ExtensionManagerContentState
);
}

material.Widget _buildTabButton(int index, String label, {int? count}) {
final isSelected = _tabIndex == index;
final displayLabel = count != null ? '$label ($count)' : label;
return SecondaryButton(
onPressed: () => setState(() => _tabIndex = index),
child: material.Text(
displayLabel,
style: material.TextStyle(
color: isSelected ? Theme.of(context).colorScheme.primary : null,
fontWeight:
isSelected ? material.FontWeight.w600 : material.FontWeight.w400,
),
),
);
}

material.Widget _buildInstalledTab() {
if (_loading) {
return const material.Center(
Expand Down
3 changes: 3 additions & 0 deletions test/features/extensions/extension_manager_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:querya_desktop/core/extensions/local_extension_registry.dart';
import 'package:querya_desktop/core/extensions/models/extension_manifest.dart';
import 'package:querya_desktop/core/extensions/models/extension_type.dart';
import 'package:querya_desktop/core/market/marketplace_repository.dart';
import 'package:querya_desktop/core/motion/querya_cross_fade_stack.dart';
import 'package:querya_desktop/features/extensions/presentation/pages/extension_manager_dialog.dart';
import 'package:querya_desktop/features/extensions/presentation/widgets/extension_card.dart';
import 'package:querya_desktop/shared/widgets/widgets.dart';
Expand Down Expand Up @@ -114,6 +115,8 @@ void main() {
expect(find.text('Installed (0)'), findsOneWidget);
expect(find.text('Marketplace'), findsOneWidget);
expect(find.text('Install from file…'), findsOneWidget);
expect(find.byType(QueryaTabStrip), findsOneWidget);
expect(find.byType(QueryaCrossFadeStack), findsOneWidget);

// Switch to Marketplace tab
await tester.tap(find.text('Marketplace'));
Expand Down
Loading