Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KAN-2] UI Redesign #47

Merged
merged 48 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
31407c8
wip: temporarily archive existing code
kyle-tennison Jun 26, 2024
87f52df
wip: panel layout
kyle-tennison Jul 10, 2024
a6ac5ba
wip: user cards
kyle-tennison Jul 10, 2024
04b20bd
wip: rooms placeholder
kyle-tennison Jul 12, 2024
0dfd8a2
wip: header layout
kyle-tennison Jul 12, 2024
5d5d08b
wip: chat input layout
kyle-tennison Jul 12, 2024
2ca631e
wip: placeholder registration page
kyle-tennison Jul 18, 2024
f7be133
wip: registration window
kyle-tennison Jul 18, 2024
9d2152d
feat: styled registration popup
kyle-tennison Jul 19, 2024
11af07c
wip: record registration payload
kyle-tennison Jul 19, 2024
be518e2
wip: add back rust
kyle-tennison Jul 22, 2024
1b74d42
feat: rust handles and message dispatching
kyle-tennison Jul 22, 2024
183fdeb
wip: successful registration
kyle-tennison Jul 23, 2024
2d98bf9
feat: local db interface
kyle-tennison Jul 23, 2024
ea5038f
feat: placeholder local db
kyle-tennison Aug 1, 2024
a60688d
feat: known server list
kyle-tennison Aug 2, 2024
a298f3f
feat: redirect after registration
kyle-tennison Aug 3, 2024
0272c16
feat: connection request
kyle-tennison Aug 3, 2024
60ea0c9
wip: move placeholder WorkspaceInfo to Home component
kyle-tennison Aug 3, 2024
4708987
feat: peer discovery backend
kyle-tennison Aug 3, 2024
cfad2bd
lint
kyle-tennison Aug 3, 2024
244df55
feat: peer connect command
kyle-tennison Aug 10, 2024
3581f75
lint
kyle-tennison Aug 10, 2024
35c5558
fix: attach listener first
kyle-tennison Aug 20, 2024
6023422
ci: add ci pipeline
kyle-tennison Aug 20, 2024
5b45c25
lint
kyle-tennison Aug 20, 2024
9db3c83
ci: use old workflow
kyle-tennison Aug 20, 2024
69cd810
ci: change cwd
kyle-tennison Aug 20, 2024
bb88406
ci: go back to new ci
kyle-tennison Aug 20, 2024
c9b44e0
fix: typo
kyle-tennison Aug 20, 2024
875c110
ci: fix branch target
kyle-tennison Aug 20, 2024
d71b3ea
ci: install `libgtk-3-dev`
kyle-tennison Aug 20, 2024
fa17fe4
ci: fix deps
kyle-tennison Aug 20, 2024
677f54f
ci: fix syntax
kyle-tennison Aug 20, 2024
51f4301
ci: continue build on error
kyle-tennison Aug 20, 2024
b083fb3
ci: fix syntax error
kyle-tennison Aug 23, 2024
77354fe
ci: bump tauri cli version
kyle-tennison Aug 23, 2024
211de94
lint
kyle-tennison Aug 23, 2024
956a286
ci: fix prettier
kyle-tennison Aug 23, 2024
0222406
ci: cancel in progress
kyle-tennison Aug 23, 2024
e506252
ci: fix missing npm
kyle-tennison Aug 23, 2024
66a0f3f
wip
kyle-tennison Aug 23, 2024
56b4ce5
lint
kyle-tennison Aug 23, 2024
f525351
wip
kyle-tennison Aug 23, 2024
9003f67
wip
kyle-tennison Aug 23, 2024
3004c74
ci: fix eslint
kyle-tennison Aug 23, 2024
fc143d5
ci: install eslint deps
kyle-tennison Aug 23, 2024
f040025
wip
kyle-tennison Aug 23, 2024
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
File renamed without changes.
1 change: 1 addition & 0 deletions .archive/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INTERNAL_SERVICE_PATH = "/Users/kyletennison/Avarok/citadel-internal-service"
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions .archive/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules/
out/
dist/
dist-ssr
*.local
target/
debug/

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

/.next/
./next-env.d.ts
# Editor directories and files
.vscode/
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
src-tauri/gen
src-tauri/target
package-lock.json
yarn.lock
src-tauri/Cargo.lock
bun.lockb
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions .archive/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Citadel Workspace

When it comes to virtual workspace security, don't slack.

Citadel Workspace is a highly cryptographically post-quantum secure work environment for individuals, businesses, and government. By using The Citadel Protocol, a protocol far more secure and adjustable than Signal and other projects, Citadel Workspace technologically stands out. Whether used for casual messaging and/or transferring highly sensitive material (whether through messages or file transfers), Citadel Workspace allows additional layers of encryption to be seamlessly added. Additionally, Citadel Workspaces allows for optional per-message re-keying, the option of pre-shared keys, and much, much more.

All code is free and 100% open-source.

### Manual Install

Install `cargo install create-tauri-app`

Run `cargo install tauri-cli --version 2.0.0-beta.1`

Install Bun JS runtime dependencies `curl -fsSL https://bun.sh/install | bash`

Install JS dependencies `bun install`

### Running

<i>Running the app from vscode's terminal can lead to an error, try running from your system terminal.</i>

Run the desktop app with `cargo tauri dev`

Run the web app with `bun run dev`

Run Storybook server with `bun run sb`
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion components.json → .archive/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"components": "@/components",
"utils": "@/lib/utils"
}
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const Layout = ({ children }: Props) => {
const [addServerOpen, setAddServerOpen] = useState(false);
const [peerToConnect, setPeerToConnect] = useState('');
const currentUsedSessionCid: string = useAppSelector(
(state) => state.context.sessions.current_used_session_server
(state) => state.context.sessions.current_used_session_server,
);

const [navigation, _] = useState([
Expand All @@ -43,11 +43,11 @@ export const Layout = ({ children }: Props) => {
]);

const current_sessions = useAppSelector(
(state) => state.context.sessions.current_sessions
(state) => state.context.sessions.current_sessions,
);

const connectedPeers = useAppSelector(
(state) => state.context.sessions.connectedPeers
(state) => state.context.sessions.connectedPeers,
);

const peers = current_sessions[currentUsedSessionCid] ?? {};
Expand Down Expand Up @@ -138,7 +138,7 @@ export const Layout = ({ children }: Props) => {
item.current
? 'bg-gray-800 text-white'
: 'text-gray-400 hover:text-white hover:bg-gray-800',
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold'
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold',
)}
>
<item.icon
Expand All @@ -164,7 +164,7 @@ export const Layout = ({ children }: Props) => {
team.current
? 'bg-gray-800 text-white'
: 'text-gray-400 hover:text-white hover:bg-gray-800',
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold'
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold',
)}
>
<span className="flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border border-gray-700 bg-gray-800 text-[0.625rem] font-medium text-gray-400 group-hover:text-white">
Expand Down Expand Up @@ -198,7 +198,7 @@ export const Layout = ({ children }: Props) => {
key
? 'bg-gray-800 text-white'
: 'text-gray-400 hover:text-white hover:bg-gray-800',
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold'
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold',
)}
>
<span className="relative inline-block">
Expand Down Expand Up @@ -260,7 +260,7 @@ export const Layout = ({ children }: Props) => {
<Link
href={`/peer/${peer}`}
className={classNames(
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold'
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold',
)}
>
<span className="flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border border-gray-700 bg-gray-800 text-[0.625rem] font-medium text-gray-400 group-hover:text-white">
Expand Down Expand Up @@ -295,7 +295,7 @@ export const Layout = ({ children }: Props) => {
>
<span
className={clsx(
peersTypeSelected === 'All Peers' && 'text-blue-800'
peersTypeSelected === 'All Peers' && 'text-blue-800',
)}
>
All Peers
Expand All @@ -308,7 +308,7 @@ export const Layout = ({ children }: Props) => {
>
<span
className={clsx(
peersTypeSelected === 'Registered' && 'text-blue-800'
peersTypeSelected === 'Registered' && 'text-blue-800',
)}
>
Registered
Expand Down Expand Up @@ -336,7 +336,7 @@ export const Layout = ({ children }: Props) => {
key
? 'bg-gray-800 text-white'
: 'text-gray-400 hover:text-white hover:bg-gray-800',
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold'
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold',
)}
>
<span className="relative inline-block">
Expand Down Expand Up @@ -371,7 +371,7 @@ export const Layout = ({ children }: Props) => {
key
? 'bg-gray-800 text-white'
: 'text-gray-400 hover:text-white hover:bg-gray-800',
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold'
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold',
)}
>
<span className="relative inline-block">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ function WorkspaceBar({
setAddServerOpener: React.Dispatch<React.SetStateAction<boolean>>;
}) {
const sessions = useAppSelector(
(state: RootState) => state.context.sessions.current_sessions
(state: RootState) => state.context.sessions.current_sessions,
);

const currentSessionInUse = useAppSelector(
(state) => state.context.sessions.current_used_session_server
(state) => state.context.sessions.current_used_session_server,
);

const currentNotification = useAppSelector(
(state) => state.notificationsContext
(state) => state.notificationsContext,
);

const dispatch = useAppDispatch();
Expand All @@ -48,7 +48,7 @@ function WorkspaceBar({
key={key}
className={clsx(
currentSessionInUse === key && 'bg-slate-300',
'rounded'
'rounded',
)}
>
<Link
Expand Down Expand Up @@ -149,7 +149,7 @@ function WorkspaceBar({
deleteFromNotificationsContext({
cid: currentSessionInUse,
peerCid: notification.peer_cid.value,
})
}),
);
}}
className="inline-flex justify-center w-full px-2 py-1.5 text-xs font-medium text-center text-white bg-blue-600 rounded-lg hover:bg-blue-700 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-500 dark:hover:bg-blue-600 dark:focus:ring-blue-800"
Expand All @@ -164,7 +164,7 @@ function WorkspaceBar({
deleteFromNotificationsContext({
cid: currentSessionInUse,
peerCid: notification.peer_cid.value,
})
}),
);
}}
className="inline-flex cursor-pointer justify-center w-full px-2 py-1.5 text-xs font-medium text-center text-gray-900 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 dark:bg-gray-600 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-700 dark:focus:ring-gray-700"
Expand All @@ -175,7 +175,7 @@ function WorkspaceBar({
</div>
</div>
);
}
},
)}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ export type RegisterAndConnectInput = {
export const serverConnect = async (input: RegisterAndConnectInput) => {
const response = invoke<RegisterAndConnectInput, string>(
'register',
input
input,
).then((response) => {
store.dispatch(
addToContext({
req_id: response,
context_type: 'RegisterAndConnect',
})
}),
);
setTimeout(() => {
invoke('get_sessions').then((req_id) => {
store.dispatch(
addToContext({
req_id,
context_type: 'GetSession',
})
}),
);
});
}, 1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ export type DisconnectInput = {
cid: string;
};
export default async function useDisconnect(
input: DisconnectInput
input: DisconnectInput,
): Promise<string> {
const response = await invoke<{ cid: string }, string>('disconnect', input);
store.dispatch(
addToContext({
req_id: response,
context_type: 'Disconnect',
})
}),
);

return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ export type ListAllPeersInput = {
cid: string;
};
export const listAllPeers = async (
input: ListAllPeersInput
input: ListAllPeersInput,
): Promise<string> => {
const response = await invoke<ListAllPeersInput, string>(
'list_all_peers',
input
input,
);
store.dispatch(
addToContext({
req_id: response,
context_type: 'ListAllPeers',
})
}),
);

return response;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ export type LocalDBClearAllKVInput = {
};

export const useLocalDBClearAllKV = async (
input: LocalDBClearAllKVInput
input: LocalDBClearAllKVInput,
): Promise<string> => {
const response = await invoke<LocalDBClearAllKVInput, string>(
'local_db_clear_all_kv',
input
input,
);
store.dispatch(
addToContext({
req_id: response,
context_type: 'LocalDBClearAllKV',
})
}),
);

return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ export type LocalDBDeleteKVInput = {
};

export const useLocalDBDeleteKV = async (
input: LocalDBDeleteKVInput
input: LocalDBDeleteKVInput,
): Promise<string> => {
const response = await invoke<LocalDBDeleteKVInput, string>(
'local_db_delete_kv',
input
input,
);
store.dispatch(
addToContext({
req_id: response,
context_type: 'LocalDBDeleteKV',
})
}),
);

return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ export type LocalDBGetAllKVInput = {
};

export const useLocalDBGetAllKV = async (
input: LocalDBGetAllKVInput
input: LocalDBGetAllKVInput,
): Promise<string> => {
const response = await invoke<LocalDBGetAllKVInput, string>(
'local_db_get_all_kv',
input
input,
);
store.dispatch(
addToContext({
req_id: response,
context_type: 'LocalDBGetAllKV',
})
}),
);

return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ export type LocalDBGetKVInput = {
};

export const useLocalDBGetKV = async (
input: LocalDBGetKVInput
input: LocalDBGetKVInput,
): Promise<string> => {
const response = await invoke<LocalDBGetKVInput, string>(
'local_db_get_kv',
input
input,
);
store.dispatch(
addToContext({
req_id: response,
context_type: 'LocalDBGetKV',
})
}),
);

return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ export type LocalDBSetKVInput = {
};

export const useLocalDBSetKV = async (
input: LocalDBSetKVInput
input: LocalDBSetKVInput,
): Promise<string> => {
const response = await invoke<LocalDBSetKVInput, string>(
'local_db_set_kv',
input
input,
);
store.dispatch(
addToContext({
req_id: response,
context_type: 'LocalDBSetKV',
})
}),
);

return response;
Expand Down
Loading
Loading