From 8c4e62e7c1a0bb6c2207607d83d289d4d4b87465 Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Sun, 5 Apr 2026 18:20:56 +0900 Subject: [PATCH] ### Fixed - Now surely remote configurations are editable in the settings dialogue. - We can fetch remote settings from the remote and apply them to the local settings for each remote configuration entry. - No longer layout breaking occurs when the description of a remote configuration entry is too long. --- src/lib | 2 +- .../SettingDialogue/PaneRemoteConfig.ts | 43 ++++++++++++++++++- styles.css | 6 +++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/lib b/src/lib index 37b8e28..963a21f 160000 --- a/src/lib +++ b/src/lib @@ -1 +1 @@ -Subproject commit 37b8e2813edbd09611d340e4810a0e31fa537521 +Subproject commit 963a21f1d20f48d0336edbea92da41629050dc7a diff --git a/src/modules/features/SettingDialogue/PaneRemoteConfig.ts b/src/modules/features/SettingDialogue/PaneRemoteConfig.ts index 8c648de..7684479 100644 --- a/src/modules/features/SettingDialogue/PaneRemoteConfig.ts +++ b/src/modules/features/SettingDialogue/PaneRemoteConfig.ts @@ -332,7 +332,16 @@ export function paneRemoteConfig( row.addButton((btn) => setEmojiButton(btn, "🔧", "Configure").onClick(async () => { - const parsed = ConnectionStringParser.parse(config.uri); + let parsed: RemoteConfigurationResult; + try { + parsed = ConnectionStringParser.parse(config.uri); + } catch (ex) { + this.services.API.addLog( + `Failed to parse remote configuration '${config.id}' for editing: ${ex}`, + LOG_LEVEL_NOTICE + ); + return; + } const workSettings = createBaseRemoteSettings(); if (parsed.type === "couchdb") { workSettings.remoteType = REMOTE_COUCHDB; @@ -430,6 +439,38 @@ export function paneRemoteConfig( }); }) .addSeparator() + .addItem((item) => { + item.setTitle("📡 Fetch remote settings").onClick(async () => { + let parsed: RemoteConfigurationResult; + try { + parsed = ConnectionStringParser.parse(config.uri); + } catch (ex) { + this.services.API.addLog( + `Failed to parse remote configuration '${config.id}': ${ex}`, + LOG_LEVEL_NOTICE + ); + return; + } + const workSettings = createBaseRemoteSettings(); + if (parsed.type === "couchdb") { + workSettings.remoteType = REMOTE_COUCHDB; + } else if (parsed.type === "s3") { + workSettings.remoteType = REMOTE_MINIO; + } else { + workSettings.remoteType = REMOTE_P2P; + } + Object.assign(workSettings, parsed.settings); + const newTweaks = + await this.services.tweakValue.checkAndAskUseRemoteConfiguration( + workSettings + ); + if (newTweaks.result !== false) { + this.editingSettings = { ...this.editingSettings, ...newTweaks.result }; + this.requestUpdate(); + } + }); + }) + .addSeparator() .addItem((item) => { item.setTitle("🗑 Delete").onClick(async () => { const confirmed = await this.services.UI.confirm.askYesNoDialog( diff --git a/styles.css b/styles.css index 0125ecc..a3b1792 100644 --- a/styles.css +++ b/styles.css @@ -73,6 +73,12 @@ overflow-y: scroll; } +.sls-remote-list .setting-item-description { + white-space: normal; + overflow-wrap: anywhere; + word-break: break-word; +} + .sls-plugins-tbl { border: 1px solid var(--background-modifier-border); width: 100%;