Skip to content

Conversation

@pedrolamas
Copy link
Member

@pedrolamas pedrolamas commented Nov 25, 2025

Adds a new "Save as" option to the File Editor, allowing to easily name a file while saving.

This also changes the Filename Change dialog behavior to select the filename portion of the filename when the dialog opens.

Smaller and more compact toolbar with tooltips

image

Save As filename dialog

image

Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas pedrolamas added this to the 1.35.1 milestone Nov 25, 2025
@pedrolamas pedrolamas requested a review from Copilot November 25, 2025 19:55
@pedrolamas pedrolamas added the FR - Enhancement New feature or request label Nov 25, 2025
Copilot finished reviewing on behalf of pedrolamas November 25, 2025 19:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a "Save As" feature to the file editor, allowing users to save the current file with a new name. The implementation includes a new toolbar button with an icon, a keyboard shortcut (Ctrl/Cmd+Shift+S), and integration with the existing file name dialog.

Key changes:

  • New "Save As" button in the file editor toolbar with tooltip and icon
  • Keyboard shortcut (Ctrl/Cmd+Shift+S) registered in Monaco editor
  • View state restoration updated to track filename changes when saving as a new file

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/locales/en.yaml Adds save_as translation key for the new "Save As" button text
src/globals.ts Imports and registers mdiContentSaveEditOutline icon for the "Save As" button
src/components/widgets/filesystem/FileNameDialog.vue Disables spellcheck on filename input field
src/components/widgets/filesystem/FileSystem.vue Adds handleSaveAsFileChanges handler that opens filename dialog and updates filename before saving
src/components/widgets/filesystem/FileEditorDialog.vue Adds "Save As" button with tooltip, updates emitSave to handle both boolean and object parameters for save options
src/components/widgets/filesystem/FileEditor.vue Adds filename watcher to update view state hash, registers Ctrl/Cmd+Shift+S keyboard shortcut, refactors path/URL computation into computed properties

Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas pedrolamas requested a review from Copilot November 26, 2025 10:52
Copilot finished reviewing on behalf of pedrolamas November 26, 2025 10:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

onFilenameChange () {
if (this.restoreViewStateStorage) {
this.viewStateHash = 'monaco.' + md5(this.apiFileUrl)
}
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

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

When the filename changes (e.g., during "Save As"), the Monaco editor model's URI is not updated. The model was created with monaco.Uri.file(this.pathFilename) in initEditor, but changing the filename prop doesn't update the model's URI. This can cause language detection issues if the file extension changes. Consider updating the model URI or recreating the model when the filename changes: this.editor?.getModel()?.dispose(); const model = monaco.editor.createModel(this.editor.getValue(), undefined, monaco.Uri.file(this.pathFilename)); this.editor?.setModel(model);

Suggested change
}
}
// Update Monaco model URI when filename changes
if (this.editor && monaco) {
const oldModel = this.editor.getModel()
if (oldModel) oldModel.dispose()
const newModel = monaco.editor.createModel(
this.editor.getValue(),
undefined,
monaco.Uri.file(this.pathFilename)
)
this.editor.setModel(newModel)
}

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Let's ignore this one for now.

Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas pedrolamas requested a review from Copilot November 26, 2025 11:18
Copilot finished reviewing on behalf of pedrolamas November 26, 2025 11:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@pedrolamas pedrolamas merged commit bf66a85 into fluidd-core:develop Nov 26, 2025
10 checks passed
@pedrolamas pedrolamas deleted the pedrolamas/save-as-support branch November 26, 2025 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FR - Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant