0.10.4: a real Sync button on every Archify page
A labelled Sync button sits top right on every Archify page, also in Source, and opens the Sync menu. On a shared model it turns green and reads Shared. The title-bar icon and the pre-share status bar entry are gone, with their settings.
This commit is contained in:
1 parent
7d2d55543e
commit
90c7be06de
10 files changed
+88
-58
No files matched your search
+1
-15
@@ -41,8 +41,6 @@ export class SyncFeature implements vscode.Disposable, LiveProvider {
|
||||
private cursorTimer: ReturnType<typeof setTimeout> | undefined;
|
||||
/** Servers with a session on this machine, for the status bar before any model is shared. */
|
||||
private signedIn: string[] = [];
|
||||
/** Whether the workspace has Archify files; elsewhere the entry stays hidden until a model is shared. */
|
||||
private archifyHere = false;
|
||||
|
||||
constructor(
|
||||
private readonly context: vscode.ExtensionContext,
|
||||
@@ -80,7 +78,6 @@ export class SyncFeature implements vscode.Disposable, LiveProvider {
|
||||
async start(): Promise<void> {
|
||||
const found = await vscode.workspace.findFiles(`**/${LINK_FILE}`, SKIP, 50);
|
||||
await Promise.all(found.map((uri) => this.open(uri, 'open')));
|
||||
this.archifyHere = (await vscode.workspace.findFiles('**/*.{archify,archify-registry,archify-decision}', SKIP, 1)).length > 0;
|
||||
await this.refreshSignedIn();
|
||||
}
|
||||
|
||||
@@ -139,19 +136,8 @@ export class SyncFeature implements vscode.Disposable, LiveProvider {
|
||||
private render(): void {
|
||||
const spaces = [...this.spaces.values()];
|
||||
if (!spaces.length) {
|
||||
this.status.hide();
|
||||
void vscode.commands.executeCommand('setContext', 'archify.sync.active', false);
|
||||
// Nothing shared here yet: the way in, as before the sync bundle loaded.
|
||||
if (!this.archifyHere || !vscode.workspace.getConfiguration('archify.sync').get<boolean>('statusBar', true)) {
|
||||
this.status.hide();
|
||||
return;
|
||||
}
|
||||
const hosts = this.signedIn.map((server) => new URL(server).host);
|
||||
this.status.text = hosts.length ? `$(cloud) Archify Sync · ${hosts.join(', ')}` : '$(cloud) Archify Sync';
|
||||
this.status.tooltip = hosts.length
|
||||
? `Signed in to ${hosts.join(', ')}. Click to share a model, join one or sign out.`
|
||||
: 'Archify Sync (optional): sign in, share a model with others or join one. Set the server under Settings › Archify › Sync.';
|
||||
this.status.backgroundColor = undefined;
|
||||
this.status.show();
|
||||
this.bridge?.changed();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user