From f83e61bb7e08551cabf7b807a3ec3411b1055f74 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 14 Dec 2024 18:48:09 -0800 Subject: [PATCH 01/14] Start adding bluesky tables --- src/database.test.ts | 3 +- src/database.ts | 67 ++++++++++++++++++++++++++ src/renderer/src/util.ts | 2 + src/renderer/src/views/AccountView.vue | 18 +++++++ 4 files changed, 89 insertions(+), 1 deletion(-) diff --git a/src/database.test.ts b/src/database.test.ts index 6a5c23d3..1a9d167f 100644 --- a/src/database.test.ts +++ b/src/database.test.ts @@ -43,7 +43,7 @@ afterEach(() => { // database tests -test("config, account, and xAccount tables should be created", async () => { +test("config, account, and xAccount, blueskyAccount tables should be created", async () => { const db = database.getMainDatabase(); const tables = await database.exec( db, @@ -55,6 +55,7 @@ test("config, account, and xAccount tables should be created", async () => { expect.objectContaining({ name: 'config' }), expect.objectContaining({ name: 'account' }), expect.objectContaining({ name: 'xAccount' }), + expect.objectContaining({ name: 'blueskyAccount' }), ])); }) diff --git a/src/database.ts b/src/database.ts index 8a609a44..d4b5fa4f 100644 --- a/src/database.ts +++ b/src/database.ts @@ -157,6 +157,42 @@ export const runMainMigrations = () => { `ALTER TABLE xAccount ADD COLUMN archiveMyData BOOLEAN DEFAULT 0;`, ] }, + // Add Bluesky table + { + name: "add Bluesky table", + sql: [ + `CREATE TABLE blueskyAccount ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + createdAt DATETIME DEFAULT CURRENT_TIMESTAMP, + updatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, + accessedAt DATETIME DEFAULT CURRENT_TIMESTAMP, + username TEXT, + profileImageDataURI TEXT, + saveMyData BOOLEAN DEFAULT 1, + deleteMyData BOOLEAN DEFAULT 0, + archivePosts BOOLEAN DEFAULT 1, + archivePostsHTML BOOLEAN DEFAULT 0, + archiveLikes BOOLEAN DEFAULT 1, + archiveDMs BOOLEAN DEFAULT 1, + deletePosts BOOLEAN DEFAULT 1, + deletePostsDaysOld INTEGER DEFAULT 0, + deletePostsLikesThresholdEnabled BOOLEAN DEFAULT 0, + deletePostsLikesThreshold INTEGER DEFAULT 20, + deletePostsRepostsThresholdEnabled BOOLEAN DEFAULT 0, + deletePostsRepostsThreshold INTEGER DEFAULT 20, + deleteReposts BOOLEAN DEFAULT 1, + deleteRepostsDaysOld INTEGER DEFAULT 0, + deleteLikes BOOLEAN DEFAULT 0, + deleteLikesDaysOld INTEGER DEFAULT 0, + deleteDMs BOOLEAN DEFAULT 0, + unfollowEveryone BOOLEAN DEFAULT 1, + followingCount INTEGER DEFAULT 0, + followersCount INTEGER DEFAULT 0, + postsCount INTEGER DEFAULT -1, + likesCount INTEGER DEFAULT -1 +);`, + ] + } ]); } @@ -216,6 +252,37 @@ interface XAccountRow { likesCount: number; } +export interface BlueskyAccountRow { + id: number; + createdAt: string; + updatedAt: string; + accessedAt: string; + username: string; + profileImageDataURI: string; + saveMyData: boolean; + deleteMyData: boolean; + archivePosts: boolean; + archivePostsHTML: boolean; + archiveLikes: boolean; + archiveDMs: boolean; + deletePosts: boolean; + deletePostsDaysOld: number; + deletePostsLikesThresholdEnabled: boolean; + deletePostsLikesThreshold: number; + deletePostsRepostsThresholdEnabled: boolean; + deletePostsRepostsThreshold: number; + deleteReposts: boolean; + deleteRepostsDaysOld: number; + deleteLikes: boolean; + deleteLikesDaysOld: number; + deleteDMs: boolean; + unfollowEveryone: boolean; + followingCount: number; + followersCount: number; + postsCount: number; + likesCount: number; +} + export interface ErrorReportRow { id: number; createdAt: string; diff --git a/src/renderer/src/util.ts b/src/renderer/src/util.ts index 7567a9bf..84d14bb5 100644 --- a/src/renderer/src/util.ts +++ b/src/renderer/src/util.ts @@ -59,6 +59,8 @@ export function getAccountIcon(accountType: string): string { // Not using the real X logo to avoid trademark issues // return "fa-brands fa-x-twitter"; return "fa-solid fa-xmark"; + case "Bluesky": + return "fa-brands fa-bluesky"; default: return "fa-solid fa-gears"; } diff --git a/src/renderer/src/views/AccountView.vue b/src/renderer/src/views/AccountView.vue index 1fde5421..653f239d 100644 --- a/src/renderer/src/views/AccountView.vue +++ b/src/renderer/src/views/AccountView.vue @@ -73,6 +73,24 @@ onMounted(async () => { +
+
+
+ +
+
+ Bluesky +
+
+ Open source, decentralized social media platform +
+
+
+
+
+

More platforms coming soon.

From 9172b06917342f8ad301c8838776b7c567a2fa3c Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 7 Jan 2025 17:31:13 -0800 Subject: [PATCH 02/14] Improve layout of platforms --- src/renderer/src/views/AccountView.vue | 48 ++++++++++++++------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/renderer/src/views/AccountView.vue b/src/renderer/src/views/AccountView.vue index 653f239d..d8cc9b88 100644 --- a/src/renderer/src/views/AccountView.vue +++ b/src/renderer/src/views/AccountView.vue @@ -55,36 +55,38 @@ onMounted(async () => { Ready to get started? Add a new account.

-