Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix/content management archive page actions column overflow #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor(content_management): replace individual buttons with PopupMe...
...nuButton 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
  • Loading branch information
fulleni committed Sep 24, 2025
commit 24ce9bc0d4e319c91d4de750f71dc591f12f5e68
56 changes: 38 additions & 18 deletions lib/content_management/view/draft_headlines_page.dart
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ class DraftHeadlinesPage extends StatelessWidget {
DataColumn2(
label: Text(l10n.actions),
size: ColumnSize.S,
fixedWidth: 120,
),
],
source: _DraftHeadlinesDataSource(
Expand Down Expand Up @@ -211,6 +210,7 @@ class _DraftHeadlinesDataSource extends DataTableSource {
DataCell(
Row(
children: [
// Primary action: Publish button
IconButton(
icon: const Icon(Icons.publish),
tooltip: l10n.publish,
Expand All @@ -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<DraftHeadlinesBloc>().add(
DeleteDraftHeadlineForeverRequested(headline.id),
);
// Secondary actions: Edit and Delete via PopupMenuButton
PopupMenuButton<String>(
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<DraftHeadlinesBloc>().add(
DeleteDraftHeadlineForeverRequested(headline.id),
);
}
},
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
PopupMenuItem<String>(
value: 'edit',
child: Row(
children: [
const Icon(Icons.edit),
const SizedBox(width: AppSpacing.sm),
Text(l10n.editHeadline),
],
),
),
PopupMenuItem<String>(
value: 'delete',
child: Row(
children: [
const Icon(Icons.delete_forever),
const SizedBox(width: AppSpacing.sm),
Text(l10n.deleteForever),
],
),
),
],
),
],
),
Expand Down

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /