Skip to content

Conversation

@Tarikhoza
Copy link

This PR implements automatic placeholder naming for save dialogs, matching the behavior from Paintroid Android. When saving images or projects, the dialog now pre-fills with sequential numbered names (image1, image2, etc. for images and project1, project2, etc. for projects).

PAINTROID-638: Jira Issue

New Features and Enhancements

  • Add automatic placeholder name generation for save image dialog with format "image[number]"
  • Add automatic placeholder name generation for save project dialog with format "project[number]"
  • Implement NameGenerator utility class to handle sequential naming logic
  • Image counter persists across app sessions using SharedPreferences
  • Project naming queries database to find next available number

Implementation Details

Files Created

  • lib/core/utils/name_generator.dart - Utility class for generating sequential names
  • test/unit/utils/name_generator_test.dart - Comprehensive unit tests (12 tests, all passing)

Files Modified

  • lib/ui/shared/dialogs/save_image_dialog.dart - Added defaultName parameter support
  • lib/core/providers/object/io_handler.dart - Generate default image names before showing dialog
  • lib/ui/pages/workspace_page/components/top_bar/overflow_menu.dart - Generate default project names before showing dialog

@juliajulie95 juliajulie95 changed the title CATROID-638 Add a placeholder name when saving PAINTROID-638 Add a placeholder name when saving Jan 8, 2026
class NameGenerator {
static const String _imageCounterKey = 'last_image_number';

/// Finds the next available project name in format "project[number]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plerase remove comments, should be clear enough :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants