Skip to content
Open
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
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="icon" type="image/x-icon" href="/images/obsidian.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap" rel="stylesheet">
Comment thread
jakes1345 marked this conversation as resolved.
</head>

<body>
Expand Down
64 changes: 64 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"dependencies": {
"@heroicons/react": "^2.2.0",
"@tauri-apps/api": "^2.10.1",
"@tauri-apps/plugin-autostart": "^2.5.1",
"@tauri-apps/plugin-deep-link": "^2.4.8",
"@tauri-apps/plugin-haptics": "^2.3.2",
"@tauri-apps/plugin-notification": "^2.2.2",
Expand All @@ -46,6 +47,7 @@
"emoji-datasource": "^16.0.0",
"emoji-picker-react": "^4.13.3",
"exifr": "^7.1.3",
"framer-motion": "^12.38.0",
"fuse.js": "^7.1.0",
"gh-pages": "^6.3.0",
"highlight.js": "^11.11.1",
Expand All @@ -60,6 +62,7 @@
"react-player": "^3.4.0",
"react-router-dom": "^7.12.0",
"react-swipeable": "^7.0.2",
"react-virtuoso": "^4.18.5",
"tailwindcss-animate": "^1.0.7",
"uuid": "^11.1.0",
"zustand": "^5.0.12"
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ tauri-build = { version = "2.0", features = [] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
log = "0.4"
tauri = { version = "2.5", features = [] }
tauri = { version = "2.5", features = ["image-ico", "image-png", "tray-icon"] }
tauri-plugin-autostart = "2.3"
tauri-plugin-log = "2.0.0-rc"
tauri-plugin-notification = "2.3"
tauri-plugin-os = "2.3"
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"notification:default",
"opener:default",
"os:default",
"deep-link:default"
"deep-link:default",
"autostart:default"
Comment thread
jakes1345 marked this conversation as resolved.
]
}
44 changes: 44 additions & 0 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,51 @@ pub fn run() {
.plugin(tauri_plugin_deep_link::init())
.plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_notification::init())
.plugin(tauri_plugin_autostart::init(tauri_plugin_autostart::MacosLauncher::LaunchAgent, Some(vec!["--minimized"])))
.setup(|app| {
#[cfg(desktop)]
{
use tauri::menu::{Menu, MenuItem};
use tauri::tray::{TrayIconBuilder, TrayIconEvent};

let show = MenuItem::with_id(app, "show", "Show ObsidianIRC", true, None::<&str>)?;
let hide = MenuItem::with_id(app, "hide", "Hide to Tray", true, None::<&str>)?;
let quit = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?;
let menu = Menu::with_items(app, &[&show, &hide, &quit])?;

let _tray = TrayIconBuilder::new()
.tooltip("ObsidianIRC")
.icon(app.default_window_icon().unwrap().clone())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakes1345
get_webview_window doesnt exist. Does this build to you?

   Compiling ObsidianIRC v0.1.0 (/Users/matheus/projects/ObsidianIRC/src-tauri)
error[E0599]: no method named `get_webview_window` found for reference `&AppHandle<_>` in the current scope
   --> src/lib.rs:247:50
    |
247 | ...                   let window = app.get_webview_window("main").unwrap();
    |                                        ^^^^^^^^^^^^^^^^^^
    |
    = help: items from traits can only be used if the trait is in scope
help: there is a method `webview_windows` with a similar name, but with different arguments
   --> /Users/matheus/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tauri-2.10.3/src/lib.rs:594:3
    |
594 |   fn webview_windows(&self) -> HashMap<String, WebviewWindow<R>> {
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: trait `Manager` which provides `get_webview_window` is implemented but not in scope; perhaps you want to import it
    |
  1 + use tauri::Manager;

.menu(&menu)
.on_menu_event(|app, event| {
match event.id.as_ref() {
"show" => {
let window = app.get_webview_window("main").unwrap();
window.show().unwrap();
window.set_focus().unwrap();
}
"hide" => {
let window = app.get_webview_window("main").unwrap();
window.hide().unwrap();
}
"quit" => {
app.exit(0);
}
_ => {}
}
})
.on_tray_icon_event(|tray, event| {
if let TrayIconEvent::Click { .. } = event {
let app = tray.app_handle();
if let Some(window) = app.get_webview_window("main") {
let _ = window.show();
let _ = window.set_focus();
}
}
})
.build(app)?;
Comment thread
jakes1345 marked this conversation as resolved.
}

if cfg!(debug_assertions) {
app.handle().plugin(
tauri_plugin_log::Builder::default()
Expand Down
12 changes: 6 additions & 6 deletions src/components/layout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ export const AppLayout: React.FC = () => {
return (
<div className="flex w-full h-full">
{__HIDE_SERVER_LIST__ ? null : (
<div className="w-[72px] flex-shrink-0 h-full bg-discord-dark-300 select-none">
<div className="w-[72px] flex-shrink-0 h-full glass select-none z-30">
<ServerList />
</div>
)}
<div className="w-[calc(100vw-72px)] h-full bg-discord-dark-100">
<div className="w-[calc(100vw-72px)] h-full glass border-l border-white/5">
<ChannelList
onToggle={() => toggleChannelList(!isChannelListVisible)}
/>
Expand All @@ -174,7 +174,7 @@ export const AppLayout: React.FC = () => {
return (
<>
{__HIDE_SERVER_LIST__ ? null : (
<div className="server-list flex-shrink-0 h-full bg-discord-dark-300 z-30 w-[72px] select-none">
<div className="server-list flex-shrink-0 h-full glass z-30 w-[72px] select-none">
<ServerList />
</div>
)}
Expand All @@ -189,7 +189,7 @@ export const AppLayout: React.FC = () => {
onMinReached={() => toggleChannelList(false)}
onWidthChange={handleChannelListWidthChange}
>
<div className="channel-list w-full h-full bg-discord-dark-100 md:block z-20">
<div className="channel-list w-full h-full glass border-l border-white/5 md:block z-20">
<ChannelList
onToggle={() => toggleChannelList(!isChannelListVisible)}
/>
Expand Down Expand Up @@ -217,7 +217,7 @@ export const AppLayout: React.FC = () => {
case "memberList":
if (isNarrowView) {
return (
<div className="w-full h-full bg-discord-dark-100">
<div className="w-full h-full glass border-l border-white/5">
<MemberList />
</div>
);
Expand All @@ -234,7 +234,7 @@ export const AppLayout: React.FC = () => {
onMinReached={() => toggleMemberList(false)}
onWidthChange={handleMemberListWidthChange}
>
<div className="flex-1 overflow-hidden h-full bg-discord-dark-100">
<div className="flex-1 overflow-hidden h-full glass border-l border-white/5">
<MemberList />
</div>
</ResizableSidebar>
Expand Down
8 changes: 4 additions & 4 deletions src/components/layout/ChannelList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export const ChannelList: React.FC<{
return (
<div className="h-full flex flex-col text-discord-channels-default">
{/* Server header */}
<div className="px-4 h-12 shadow-md flex items-center justify-between border-b border-discord-dark-400">
<div className="px-4 h-12 glass shadow-md flex items-center justify-between border-b border-white/5">
<div className="flex flex-col min-w-0 flex-1">
<h1 className="font-bold text-white truncate">
{selectedServer?.networkName || selectedServer?.name || "Home"}
Expand Down Expand Up @@ -477,7 +477,7 @@ export const ChannelList: React.FC<{
{/* Add Channel Input */}
{newChannelName !== "" && (
<div className="px-2 py-1 mb-1">
<div className="flex items-center bg-discord-dark-400 rounded overflow-hidden max-w-full">
<div className="flex items-center glass rounded overflow-hidden max-w-full">
<span className="pl-2 pr-1 text-discord-channels-default">
<FaHashtag />
</span>
Expand Down Expand Up @@ -551,8 +551,8 @@ export const ChannelList: React.FC<{
shadow-sm
${
selectedChannelId === channel.id
? "bg-black text-white"
: `bg-discord-dark-400/50 ${hoverPrimary}`
? "bg-black/40 text-white shadow-lg shadow-black/20"
: `glass ${hoverPrimary}`
}
${
prevItemId === channel.id &&
Expand Down
Loading
Loading