-
Notifications
You must be signed in to change notification settings - Fork 154
Description
Motivation
When users open multiple files of the same type (e.g., multiple PDF documents or spreadsheets) in Puter, all windows display the same generic application name as their title. This makes it difficult to distinguish between windows and navigate between different open files, creating a poor user experience when working with multiple documents simultaneously.
Application developers should have the ability to opt-in to automatically setting their app's window title to the opened file's name. This would help users identify which file is open in which window, improving multitasking and window management. This feature should be configurable through the app settings in the developer center, giving developers control over their app's window behavior.
Current Behavior
When multiple files are opened in the same application, all windows display the same title (the application name). There is no way for developers to configure their apps to automatically use the opened file's name as the window title.
Reproduction Steps:
- Navigate to the Puter desktop
- Create or locate two different PDF files (e.g., "document1.pdf" and "document2.pdf")
- Open both PDF files in the default PDF viewer application
- Observe: Both windows show the same title (the application name), making it impossible to distinguish which window contains which document without clicking into each window
- Navigate to the developer center and edit any application
- Observe: There is no setting available to control window title behavior for opened files
Expected Behavior
Developers should be able to enable a setting in the app edit section that automatically sets the window title to the opened file's name when users open files in their application. When this setting is enabled and a user opens a file, the window title should display the file's basename instead of just the application name.
Acceptance Criteria:
- A new checkbox option is available in the app edit section labeled "Automatically set window title to opened file's name"
- The checkbox state is properly saved when updating an app's settings
- The checkbox state is correctly loaded and displayed when editing an existing app
- When the setting is enabled for an app, opening a file in that app sets the window title to the file's name
- The form change tracking system properly detects changes to this new checkbox
- The reset functionality properly restores the original checkbox state when discarding changes
Verification
Manual Testing:
- Open the developer center and navigate to edit an existing application
- Verify the new checkbox appears in the app settings with appropriate label and description
- Enable the checkbox and save the application settings
- Reload the app edit page and verify the checkbox remains checked
- Open a file with a specific name (e.g., "test-document.pdf") using the configured application
- Verify the window title displays "test-document.pdf" instead of just the application name
- Open multiple different files in the same application and verify each window shows its respective file name
- Test the form change detection by toggling the checkbox and verifying the save/cancel buttons respond appropriately
- Test the reset functionality by making changes and clicking cancel to verify the checkbox returns to its original state
Automated Testing:
Run the existing test suite to ensure no regressions were introduced in the app settings functionality.
Submission
Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.
Guide to submitting pull requests: https://hackmd.io/@timothy1ee/Hky8kV3hlx