Skip to content

Commit 5bbb850

Browse files
committed
feat(files_sharing): add hidden killswitch for the new sharing dialog
Add a hidden appconfig `files_sharing sharing_dialog_enabled` (BOOL, default true) surfaced to the sidebar via initial state. When enabled the sidebar uses the new unified sharing dialog; setting it to false temporarily restores the legacy inline sharing UI. Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent bff9aaf commit 5bbb850

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

apps/files_sharing/lib/Config/ConfigLexicon.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class ConfigLexicon implements ILexicon {
2626
public const EXCLUDE_RESHARE_FROM_EDIT = 'shareapi_exclude_reshare_from_edit';
2727
public const UPDATE_CUTOFF_TIME = 'update_cutoff_time';
2828
public const USER_NEEDS_SHARE_REFRESH = 'user_needs_share_refresh';
29+
public const SHARING_DIALOG_ENABLED = 'sharing_dialog_enabled';
2930

3031
#[\Override]
3132
public function getStrictness(): Strictness {
@@ -40,6 +41,10 @@ public function getAppConfigs(): array {
4041
new Entry(self::EXCLUDE_RESHARE_FROM_EDIT, ValueType::BOOL, false, 'Exclude reshare permission from "Allow editing" bundled permissions'),
4142

4243
new Entry(self::UPDATE_CUTOFF_TIME, ValueType::FLOAT, 3.0, 'Maximum time in second during which we update the share data immediately before switching to only marking the user'),
44+
45+
// Hidden killswitch: enables the new unified sharing dialog UI in the sidebar.
46+
// Set to false to temporarily restore the legacy sharing inputs and menus.
47+
new Entry(self::SHARING_DIALOG_ENABLED, ValueType::BOOL, true, 'Use the new unified sharing dialog in the files sidebar instead of the legacy inline UI', true),
4348
];
4449
}
4550

apps/files_sharing/lib/Listener/LoadSidebarListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ public function handle(Event $event): void {
4747
$showExternalSharing = $appConfig->getValueBool('files_sharing', 'outgoing_server2server_share_enabled', true)
4848
|| $appConfig->getValueBool('core', 'shareapi_allow_links', true);
4949

50+
$sharingDialogEnabled = $appConfig->getValueBool('files_sharing', ConfigLexicon::SHARING_DIALOG_ENABLED, true);
51+
5052
$this->initialState->provideInitialState('showFederatedSharesAsInternal', $showFederatedAsInternal);
5153
$this->initialState->provideInitialState('showFederatedSharesToTrustedServersAsInternal', $showFederatedToTrustedAsInternal);
5254
$this->initialState->provideInitialState('showExternalSharing', $showExternalSharing);
55+
$this->initialState->provideInitialState('sharingDialogEnabled', $sharingDialogEnabled);
5356
}
5457
}

apps/files_sharing/src/services/ConfigService.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,4 +344,13 @@ export default class Config {
344344
get showExternalSharing(): boolean {
345345
return loadState('files_sharing', 'showExternalSharing', true)
346346
}
347+
348+
/**
349+
* Whether the new unified sharing dialog replaces the legacy inline sharing UI.
350+
* Hidden killswitch (appconfig files_sharing sharing_dialog_enabled); set to
351+
* false to temporarily restore the legacy inputs and menus.
352+
*/
353+
get sharingDialogEnabled(): boolean {
354+
return loadState('files_sharing', 'sharingDialogEnabled', true)
355+
}
347356
}

0 commit comments

Comments
 (0)