Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
"themeCatalogBaseUrl": "https://raw.githubusercontent.com/SableClient/themes/main/",
"themeCatalogApprovedHostPrefixes": ["https://raw.githubusercontent.com/SableClient/themes/"],

"slidingSync": {
"enabled": true
},

"featuredCommunities": {
"openAsDefault": false,
"spaces": [
Expand Down
18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@

<link id="favicon" rel="shortcut icon" href="./public/favicon.png" />

<style>
html,
body {
background-color: #1b1a21;
background-image: radial-gradient(#2d2c36 2px, #1b1a21 2px);
background-size: 40px 40px;
color: #eae8f0;
}
@media (prefers-color-scheme: light) {
html,
body {
background-color: #ffffff;
background-image: radial-gradient(#e4e4e7 2px, #ffffff 2px);
color: #18181b;
}
}
</style>

<link rel="manifest" href="/manifest.json" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="application-name" content="Sable" />
Expand Down
99 changes: 0 additions & 99 deletions src/app/components/ClientConfigLoader.test.tsx

This file was deleted.

39 changes: 0 additions & 39 deletions src/app/components/ClientConfigLoader.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/components/SpecVersionsLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function SpecVersionsLoader({
}

if (!ignoreError && state.status === AsyncStatus.Error) {
return error?.(state.error, load, ignoreCallback);
if (error) return error(state.error, load, ignoreCallback);
}

return children(
Expand Down
2 changes: 0 additions & 2 deletions src/app/features/settings/experimental/Experimental.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useSetting } from '$state/hooks/settings';
import { SequenceCardStyle } from '$features/common-settings/styles.css';
import { SettingTile } from '$components/setting-tile';
import { SequenceCard } from '$components/sequence-card';
import { Sync } from '../general';
import { SettingsSectionPage } from '../SettingsSectionPage';
import { BandwidthSavingEmojis } from './BandwithSavingEmojis';
import { MSC4268HistoryShare } from './MSC4268HistoryShare';
Expand Down Expand Up @@ -60,7 +59,6 @@ export function Experimental({ requestBack, requestClose }: Readonly<Experimenta
/>
<br />
<Box direction="Column" gap="700">
<Sync />
<MSC4268HistoryShare />
<BandwidthSavingEmojis />
<PersonaToggle />
Expand Down
114 changes: 36 additions & 78 deletions src/app/features/settings/general/General.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ import { useMessageSpacingItems } from '$hooks/useMessageSpacing';
import { useDateFormatItems } from '$hooks/useDateFormat';
import { SequenceCardStyle } from '$features/settings/styles.css';
import { sessionsAtom, activeSessionIdAtom } from '$state/sessions';
import { useClientConfig } from '$hooks/useClientConfig';
import { resolveSlidingEnabled } from '$client/initMatrix';
import { isKeyHotkey } from 'is-hotkey';
import { settingsSyncLastSyncedAtom, settingsSyncStatusAtom } from '$hooks/useSettingsSync';
import { exportSettingsAsJson, importSettingsFromJson } from '$utils/settingsSync';
Expand Down Expand Up @@ -1380,14 +1378,17 @@ function Embeds() {
);
}

export function Sync() {
const clientConfig = useClientConfig();
type GeneralProps = {
requestBack?: () => void;
requestClose: () => void;
};

function Sync() {
const sessions = useAtomValue(sessionsAtom);
const activeSessionId = useAtomValue(activeSessionIdAtom);
const setSessions = useSetAtom(sessionsAtom);
const activeSession = sessions.find((s) => s.userId === activeSessionId) ?? sessions[0];

const serverSlidingEnabled = resolveSlidingEnabled(clientConfig.slidingSync?.enabled);
const useSlidingSync = activeSession?.slidingSyncOptIn === true;

const handleSetSlidingSync = (value: boolean) => {
Expand All @@ -1402,76 +1403,6 @@ export function Sync() {
window.location.reload();
};

return (
<Box direction="Column" gap="100">
<Text size="L400" style={{ opacity: serverSlidingEnabled ? 1 : 0.5 }}>
Sync
</Text>
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
style={{ opacity: serverSlidingEnabled ? 1 : 0.5 }}
>
<SettingTile
title="Use Sliding Sync"
focusId="use-sliding-sync"
description={
serverSlidingEnabled ? (
<>
Enable Sliding Sync for this current login/session. Requires server support and
admin configuration.{' '}
<a
href="https://github.com/matrix-org/matrix-spec-proposals/blob/erikj/sss/proposals/4186-simplified-sliding-sync.md"
target="_blank"
rel="noreferrer"
>
More info/Documentation
</a>
.{' '}
<a
href="https://github.com/SableClient/Sable/issues/39"
target="_blank"
rel="noreferrer"
>
Known issues (Sable GitHub)
</a>
.
</>
) : (
<>
Unavailable: the server has disabled Sliding Sync in its config.{' '}
<a
href="https://github.com/matrix-org/matrix-spec-proposals/blob/erikj/sss/proposals/4186-simplified-sliding-sync.md"
target="_blank"
rel="noreferrer"
>
More info
</a>
.
</>
)
}
after={
<Switch
variant="Primary"
value={useSlidingSync}
onChange={handleSetSlidingSync}
disabled={!serverSlidingEnabled}
/>
}
/>
</SequenceCard>
</Box>
);
}

type GeneralProps = {
requestBack?: () => void;
requestClose: () => void;
};

function SettingsSyncSection() {
const [syncEnabled, setSyncEnabled] = useSetting(settingsAtom, 'settingsSyncEnabled');
const lastSynced = useAtomValue(settingsSyncLastSyncedAtom);
const syncStatus = useAtomValue(settingsSyncStatusAtom);
Expand Down Expand Up @@ -1500,15 +1431,42 @@ function SettingsSyncSection() {

return (
<Box direction="Column" gap="100">
<Text size="L400">Settings Sync & Backup</Text>
<Text size="L400">Data Syncing</Text>
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
gap="400"
>
<SettingTile
title="Use Sliding Sync"
focusId="use-sliding-sync"
description={
<>
Enable Sliding Sync for this current login/session. Requires server support.{' '}
<a
href="https://github.com/SableClient/Sable/issues/39"
target="_blank"
rel="noreferrer"
>
Known issues (Sable GitHub)
</a>
.
</>
}
after={
<Switch variant="Primary" value={useSlidingSync} onChange={handleSetSlidingSync} />
}
/>
</SequenceCard>
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
gap="400"
>
<SettingTile
title="Sync across devices"
title="Sync settings across devices"
focusId="sync-across-devices"
description="Store your settings in your Matrix account so they follow you to any Sable instance. Notification and zoom preferences are kept per-device."
after={<Switch variant="Primary" value={syncEnabled} onChange={setSyncEnabled} />}
Expand Down Expand Up @@ -1669,7 +1627,7 @@ export function General({ requestBack, requestClose }: Readonly<GeneralProps>) {
<Messages />
<Embeds />
<Calls />
<SettingsSyncSection />
<Sync />
<DiagnosticsAndPrivacy />
</Box>
</PageContent>
Expand Down
Loading
Loading