New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat#5688: Save As Profile option available for all tabs #8663
Conversation
…session end with 'Save As' Profile
Wow - great job! Thank you for your continued efforts improving the app by the way :)
|
Thank's for your quick feedback. Well, I'm really glad to know that I'm able to help a bit with my small skills. I would like to help more but the greatest majority of issues stills absolutely out of my league for now ahah
|
Sorry for the delay,
async save (): Promise<void> {
await lastValueFrom(this.ready$)
if (!this._store) {
throw new Error('Cannot save an empty store')
}
// Scrub undefined values
let cleanStore = JSON.parse(JSON.stringify(this._store))
// cleanStore = await this.maybeEncryptConfig(cleanStore)
await this.platform.saveConfig(yaml.dump(cleanStore))
this.emitChange()
} Ready to merge from my side if you are ok with .1 and with the |
Found it! Reading his console log, the error is in
|
This reverts commit 82a2620.
Ohhh I see, great! I totally missed that... Thank's for the explanation |
Hi @Eugeny, I hope you are doing well !
I took a look on the feature request #5688 . This PR aims to make the 'Save As Profile' context menu item available for all tabs.
I saw that they were no ID setted with the new saved profile before. It causes the profile to not be shown in the
Profiles & Connections
selector since the commit c983743 :tabby/tabby-core/src/services/profiles.service.ts
Line 156 in c983743
Should we create a recovery mechanism? Like creating an ID for profile those does not have one when the config is saved. What would be your approach on this?
During my test, I encountered the same issue as the one describe in The settings button doesn't respond sometimes #8534.
tabby/tabby-core/src/services/config.service.ts
Lines 200 to 210 in c983743
JSON.parse(JSON.stringify(this._store))
and in rare case, some invalid yaml type seems to be present in the config object on yaml dump. Sadly I wasn't able to identify which part precisely... Anyway, addingskipInvalid: true
in yaml dump option prevent the method to raise{name: 'YAMLException', reason: 'unacceptable kind of an object to dump [object Function]'}
by skipping invalid type.Also, It could be great to do a bit of refactoring in the future and create methods in the ProfileService for profile creation, edition and deletion to have only one entrypoint for profile operation. It would be simpler to maintain. What do you think ?
As always, feel free to ask me if changes needed :)
Resolve #5688