Skip to content

Conversation

@PrayagCodes
Copy link

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

  • New checkbox setting in Dev Center app configuration
  • Stored in app metadata as use_file_name_as_window_title
  • Fully integrated with existing form tracking system
  • Window title determination logic updated to respect the setting
  • Backward compatible - disabled by default

Changes

Frontend (Dev Center)

File: src/dev-center/js/dev-center.js

  • Added checkbox UI in Window settings section (line 583)
  • Integrated with trackOriginalValues() function (line 661)
  • Added to hasChanges() detection logic (line 699)
  • Included in resetToOriginalValues() function (line 740)
  • Added to save handler metadata object (line 1249)

Backend Logic

File: src/gui/src/helpers/launch_app.js

  • Updated title determination logic (lines 70-78)
  • Checks metadata flag before setting window title
  • Prefers filename when setting enabled and file is being opened

Technical 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:

  1. A window title is provided (the filename)
  2. The app has the setting enabled in metadata
  3. A file is being opened (not just launching the app)

Form Tracking Integration

The checkbox follows the existing pattern used by other settings:

  • Initial state tracked on page load
  • Changes detected for Save/Reset button states
  • Reset functionality restores original value
  • All states properly serialized to metadata

Add developer-configurable setting to automatically set window titles
to opened file names instead of app names. This improves multi-file
workflows by making windows easily distinguishable.

Changes:
* Add 'Use file name as window title' checkbox in Dev Center
* Integrate checkbox with form tracking (save/reset/change detection)
* Store setting in app metadata as use_file_name_as_window_title
* Implement window title logic in launch_app.js
* Fix app creation race condition with authUsername

The feature is opt-in by design to maintain backward compatibility.
When enabled, windows show 'document.pdf' instead of 'PDF Viewer',
making it easy to identify which file is open in each window.
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.

1 participant