From 86b3a50ad70b4fc9a8a13095ca0a6a74b1a9242f Mon Sep 17 00:00:00 2001 From: fulleni Date: 2025年9月24日 20:19:51 +0100 Subject: [PATCH 1/5] feat(l10n): add tooltip for row actions menu in table - Add new localization entries for "moreActions" in both Arabic and English - Provide descriptions for the new entries to clarify their usage --- lib/l10n/app_localizations.dart | 6 ++++++ lib/l10n/app_localizations_ar.dart | 3 +++ lib/l10n/app_localizations_en.dart | 3 +++ lib/l10n/arb/app_ar.arb | 4 ++++ lib/l10n/arb/app_en.arb | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 84a348ba..22260fd1 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -2593,6 +2593,12 @@ abstract class AppLocalizations { /// In en, this message translates to: /// **'Enable In-Article Ads for {role}'** String enableInArticleAdsForRoleLabel(String role); + + /// Tooltip for the button that opens a menu with more actions for a table row. + /// + /// In en, this message translates to: + /// **'More Actions'** + String get moreActions; } class _AppLocalizationsDelegate diff --git a/lib/l10n/app_localizations_ar.dart b/lib/l10n/app_localizations_ar.dart index b49f7465..77daf864 100644 --- a/lib/l10n/app_localizations_ar.dart +++ b/lib/l10n/app_localizations_ar.dart @@ -1387,4 +1387,7 @@ class AppLocalizationsAr extends AppLocalizations { String enableInArticleAdsForRoleLabel(String role) { return 'تمكين الإعلانات داخل المقال لـ $role'; } + + @override + String get moreActions => 'المزيد من الإجراءات'; } diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 5d6cfeea..98ab1f3b 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -1392,4 +1392,7 @@ class AppLocalizationsEn extends AppLocalizations { String enableInArticleAdsForRoleLabel(String role) { return 'Enable In-Article Ads for $role'; } + + @override + String get moreActions => 'More Actions'; } diff --git a/lib/l10n/arb/app_ar.arb b/lib/l10n/arb/app_ar.arb index ec5d8ae0..8bc5135d 100644 --- a/lib/l10n/arb/app_ar.arb +++ b/lib/l10n/arb/app_ar.arb @@ -1755,5 +1755,9 @@ "example": "مستخدم ضيف" } } + }, + "moreActions": "المزيد من الإجراءات", + "@moreActions": { + "description": "تلميح الزر الذي يفتح قائمة تحتوي على المزيد من الإجراءات لصف في الجدول." } } \ No newline at end of file diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index aed3f985..544aaa72 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -1751,5 +1751,9 @@ "example": "Guest User" } } + }, + "moreActions": "More Actions", + "@moreActions": { + "description": "Tooltip for the button that opens a menu with more actions for a table row." } } \ No newline at end of file From 24ce9bc0d4e319c91d4de750f71dc591f12f5e68 Mon Sep 17 00:00:00 2001 From: fulleni Date: 2025年9月24日 20:19:58 +0100 Subject: [PATCH 2/5] refactor(content_management): replace individual buttons with PopupMenuButton for secondary actions - Remove fixedWidth from DataColumn2 - Replace Edit and Delete buttons with a PopupMenuButton - Add 'edit' and 'delete' options to the popup menu - Update tooltips and icons for the new menu items --- .../view/draft_headlines_page.dart | 56 +++++++++++++------ 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/lib/content_management/view/draft_headlines_page.dart b/lib/content_management/view/draft_headlines_page.dart index 32caef21..08ca2880 100644 --- a/lib/content_management/view/draft_headlines_page.dart +++ b/lib/content_management/view/draft_headlines_page.dart @@ -122,7 +122,6 @@ class DraftHeadlinesPage extends StatelessWidget { DataColumn2( label: Text(l10n.actions), size: ColumnSize.S, - fixedWidth: 120, ), ], source: _DraftHeadlinesDataSource( @@ -211,6 +210,7 @@ class _DraftHeadlinesDataSource extends DataTableSource { DataCell( Row( children: [ + // Primary action: Publish button IconButton( icon: const Icon(Icons.publish), tooltip: l10n.publish, @@ -220,24 +220,44 @@ class _DraftHeadlinesDataSource extends DataTableSource { ); }, ), - IconButton( - icon: const Icon(Icons.edit), - tooltip: l10n.editHeadline, - onPressed: () { - context.goNamed( - Routes.editHeadlineName, - pathParameters: {'id': headline.id}, - ); - }, - ), - IconButton( - icon: const Icon(Icons.delete_forever), - tooltip: l10n.deleteForever, - onPressed: () { - context.read().add( - DeleteDraftHeadlineForeverRequested(headline.id), - ); + // Secondary actions: Edit and Delete via PopupMenuButton + PopupMenuButton( + icon: const Icon(Icons.more_vert), + tooltip: l10n.moreActions, + onSelected: (value) { + if (value == 'edit') { + context.goNamed( + Routes.editHeadlineName, + pathParameters: {'id': headline.id}, + ); + } else if (value == 'delete') { + context.read().add( + DeleteDraftHeadlineForeverRequested(headline.id), + ); + } }, + itemBuilder: (BuildContext context) => >[ + PopupMenuItem( + value: 'edit', + child: Row( + children: [ + const Icon(Icons.edit), + const SizedBox(width: AppSpacing.sm), + Text(l10n.editHeadline), + ], + ), + ), + PopupMenuItem( + value: 'delete', + child: Row( + children: [ + const Icon(Icons.delete_forever), + const SizedBox(width: AppSpacing.sm), + Text(l10n.deleteForever), + ], + ), + ), + ], ), ], ), From 16654468f625876b4fd751652b2cf2861cc761ec Mon Sep 17 00:00:00 2001 From: fulleni Date: 2025年9月24日 20:20:24 +0100 Subject: [PATCH 3/5] refactor(content_management): replace multiple IconButton with PopupMenuButton - Remove fixedWidth constraint from DataColumn2 - Replace individual Edit and Delete IconButtons with a PopupMenuButton - Add more_vert icon for secondary actions - Implement PopupMenuEntry for Edit and Delete options - Maintain the existing functionality and navigation --- .../view/draft_sources_page.dart | 56 +++++++++++++------ 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/lib/content_management/view/draft_sources_page.dart b/lib/content_management/view/draft_sources_page.dart index f6688d6e..119fc2a0 100644 --- a/lib/content_management/view/draft_sources_page.dart +++ b/lib/content_management/view/draft_sources_page.dart @@ -118,7 +118,6 @@ class DraftSourcesPage extends StatelessWidget { DataColumn2( label: Text(l10n.actions), size: ColumnSize.S, - fixedWidth: 120, ), ], source: _DraftSourcesDataSource( @@ -206,6 +205,7 @@ class _DraftSourcesDataSource extends DataTableSource { DataCell( Row( children: [ + // Primary action: Publish button IconButton( icon: const Icon(Icons.publish), tooltip: l10n.publish, @@ -215,24 +215,44 @@ class _DraftSourcesDataSource extends DataTableSource { ); }, ), - IconButton( - icon: const Icon(Icons.edit), - tooltip: l10n.editSource, - onPressed: () { - context.goNamed( - Routes.editSourceName, - pathParameters: {'id': source.id}, - ); - }, - ), - IconButton( - icon: const Icon(Icons.delete_forever), - tooltip: l10n.deleteForever, - onPressed: () { - context.read().add( - DeleteDraftSourceForeverRequested(source.id), - ); + // Secondary actions: Edit and Delete via PopupMenuButton + PopupMenuButton( + icon: const Icon(Icons.more_vert), + tooltip: l10n.moreActions, + onSelected: (value) { + if (value == 'edit') { + context.goNamed( + Routes.editSourceName, + pathParameters: {'id': source.id}, + ); + } else if (value == 'delete') { + context.read().add( + DeleteDraftSourceForeverRequested(source.id), + ); + } }, + itemBuilder: (BuildContext context) => >[ + PopupMenuItem( + value: 'edit', + child: Row( + children: [ + const Icon(Icons.edit), + const SizedBox(width: AppSpacing.sm), + Text(l10n.editSource), + ], + ), + ), + PopupMenuItem( + value: 'delete', + child: Row( + children: [ + const Icon(Icons.delete_forever), + const SizedBox(width: AppSpacing.sm), + Text(l10n.deleteForever), + ], + ), + ), + ], ), ], ), From 1b63ce6d062dbebd005ec1258ea9e3e27ae1c641 Mon Sep 17 00:00:00 2001 From: fulleni Date: 2025年9月24日 20:20:31 +0100 Subject: [PATCH 4/5] refactor(content_management): replace individual buttons with PopupMenuButton for secondary actions - Remove fixedWidth from DataColumn2 to resolve layout issue - Replace Edit and Delete buttons with a single PopupMenuButton - Add more_vert icon for secondary actions - Implement itemBuilder for PopupMenuButton to include Edit and Delete options - Update action tooltips and localization strings --- .../view/draft_topics_page.dart | 56 +++++++++++++------ 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/lib/content_management/view/draft_topics_page.dart b/lib/content_management/view/draft_topics_page.dart index f624f028..6a4bb77e 100644 --- a/lib/content_management/view/draft_topics_page.dart +++ b/lib/content_management/view/draft_topics_page.dart @@ -118,7 +118,6 @@ class DraftTopicsPage extends StatelessWidget { DataColumn2( label: Text(l10n.actions), size: ColumnSize.S, - fixedWidth: 120, ), ], source: _DraftTopicsDataSource( @@ -206,6 +205,7 @@ class _DraftTopicsDataSource extends DataTableSource { DataCell( Row( children: [ + // Primary action: Publish button IconButton( icon: const Icon(Icons.publish), tooltip: l10n.publish, @@ -215,24 +215,44 @@ class _DraftTopicsDataSource extends DataTableSource { ); }, ), - IconButton( - icon: const Icon(Icons.edit), - tooltip: l10n.editTopic, - onPressed: () { - context.goNamed( - Routes.editTopicName, - pathParameters: {'id': topic.id}, - ); - }, - ), - IconButton( - icon: const Icon(Icons.delete_forever), - tooltip: l10n.deleteForever, - onPressed: () { - context.read().add( - DeleteDraftTopicForeverRequested(topic.id), - ); + // Secondary actions: Edit and Delete via PopupMenuButton + PopupMenuButton( + icon: const Icon(Icons.more_vert), + tooltip: l10n.moreActions, + onSelected: (value) { + if (value == 'edit') { + context.goNamed( + Routes.editTopicName, + pathParameters: {'id': topic.id}, + ); + } else if (value == 'delete') { + context.read().add( + DeleteDraftTopicForeverRequested(topic.id), + ); + } }, + itemBuilder: (BuildContext context) => >[ + PopupMenuItem( + value: 'edit', + child: Row( + children: [ + const Icon(Icons.edit), + const SizedBox(width: AppSpacing.sm), + Text(l10n.editTopic), + ], + ), + ), + PopupMenuItem( + value: 'delete', + child: Row( + children: [ + const Icon(Icons.delete_forever), + const SizedBox(width: AppSpacing.sm), + Text(l10n.deleteForever), + ], + ), + ), + ], ), ], ), From 6ef97655e219887e6eb26a2f6be2aaa589d0a222 Mon Sep 17 00:00:00 2001 From: fulleni Date: 2025年9月24日 20:20:52 +0100 Subject: [PATCH 5/5] style(README): update test coverage badge color - Change coverage badge color from green to red - Remove alt text for coverage badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11614a51..380fd554 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@

Live Demo: View Documentation: Read - coverage: 0% +

Trial License: View Terms

AltStyle によって変換されたページ (->オリジナル) /