feat: add opt-in window title from filename for apps #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds a developer-configurable setting to automatically set window titles to opened file names instead of app names, improving multi-file workflow usability.
Problem
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 currently have no way to configure their apps to use file names as window titles, forcing users to click into each window to identify which file is open.
Solution
This PR implements an opt-in checkbox in the Developer Center that allows app developers to enable automatic window title setting based on opened file names.
Key Features
use_file_name_as_window_titleChanges
Frontend (Dev Center)
File:
src/dev-center/js/dev-center.jstrackOriginalValues()function (line 661)hasChanges()detection logic (line 699)resetToOriginalValues()function (line 740)Backend Logic
File:
src/gui/src/helpers/launch_app.jsTechnical Details
Window Title Logic
if (options.window_title &&
app_info.metadata?.use_file_name_as_window_title &&
options.file_path)
{
title = options.window_title;
}
else if (app_info.title) {
title = app_info.title;
}The logic checks three conditions:
Form Tracking Integration
The checkbox follows the existing pattern used by other settings: