diff --git a/docs/docs/releases.md b/docs/docs/releases.md index 2d74730835..782c910a56 100644 --- a/docs/docs/releases.md +++ b/docs/docs/releases.md @@ -14,6 +14,7 @@ language: 'en' - Default navigation on MacOS is now `NativeTab` with `window.decorations = "transparent"`. - Default navigation on Linux/BSD/Windows is now BottomTab. - Fix font emoji width. +- Fix MacOS tabbing when spawned from a new window. ## 0.1.13 diff --git a/docs/src/components/MentionsSection/index.js b/docs/src/components/MentionsSection/index.js index f1629c55f7..43d2987911 100644 --- a/docs/src/components/MentionsSection/index.js +++ b/docs/src/components/MentionsSection/index.js @@ -8,14 +8,15 @@ import styles from './styles.module.css'; /** * @typedef {Object} MentionCardProps - * @property {string} tweetUrl + * @property {string} url * @property {string} username + * @property {string} source * @property {import('react').ReactNode} quote * * @param {MentionCardProps} props */ function MentionCard(props) { - const { tweetUrl, username, quote } = props; + const { url, username, quote, source } = props; return (
@@ -23,7 +24,7 @@ function MentionCard(props) {
- + @{username}
-
+
{quote}
@@ -67,7 +68,7 @@ export default function MentionsSection() { {COLUMNS.map((column, i) => (
{column.map((mention) => ( - + ))}
))} diff --git a/docs/src/data/features.js b/docs/src/data/features.js index 1d24396d98..6fb5405278 100644 --- a/docs/src/data/features.js +++ b/docs/src/data/features.js @@ -6,6 +6,7 @@ import Image from '@site/static/assets/feature-icons/image.svg'; import Lightning from '@site/static/assets/feature-icons/lightning.svg'; import Palette from '@site/static/assets/feature-icons/palette.svg'; import FontLigatures from '@site/static/assets/feature-icons/font-ligatures.svg'; +import Splits from '@site/static/assets/feature-icons/splits.svg'; /** * @satisfies {import('@site/src/components/FeaturesSection/index').FeatureCardProps[]} @@ -45,7 +46,7 @@ const FEATURES = [ Icon: Image, description: ( - The Rio can display images within the terminal using Sixel and iTerm2 + Display images within the terminal using Sixel and iTerm2 image protocol. ), @@ -71,11 +72,23 @@ const FEATURES = [ Icon: FontLigatures, description: ( - Rio provide font ligatures support as a way to improve readability of + Font ligatures support as a way to improve readability of common expressions or operators. ), }, + { + title: translate({ + message: 'Splits', + id: 'home.features.font-ligatures.title', + }), + Icon: Splits, + description: ( + + Support to split and manage terminal screens in any platform that you would want to. + + ), + }, ]; export default FEATURES; diff --git a/docs/src/data/mentions.js b/docs/src/data/mentions.js index 531f68f96b..69087d969d 100644 --- a/docs/src/data/mentions.js +++ b/docs/src/data/mentions.js @@ -3,8 +3,9 @@ /** @satisfies {import('@site/src/components/MentionsSection/index').MentionCardProps[]} */ const MENTIONS = [ { - tweetUrl: 'https://twitter.com/jaijams/status/1716815864975270005', + url: 'https://twitter.com/jaijams/status/1716815864975270005', username: 'jaijams', + source: '/rio/assets/mentions/jaijams.jpg', quote: ( <> I have been using the Rio terminal (https://raphamorim.io/rio/) for 6 @@ -14,8 +15,19 @@ const MENTIONS = [ ), }, { - tweetUrl: 'https://twitter.com/mcsmonte/status/1660949303089586177', + url: '', + username: 'simonnyberg', + source: '/rio/assets/mentions/simonnyberg.png', + quote: ( + <> + Rio has become my standard terminal emulator for some time and it works well in professional use. Raphael is doing a great work and is awesome at listening to feedback to the community for new and improved features. + + ), + }, + { + url: 'https://twitter.com/mcsmonte/status/1660949303089586177', username: 'mcsmonte', + source: '/rio/assets/mentions/mcsmonte.jpg', quote: ( <> This week I'm testing rio, a rust based terminal and I need to say: It's @@ -26,18 +38,21 @@ const MENTIONS = [ ), }, { - tweetUrl: 'https://twitter.com/moeyua13/status/1665983183526195200', + url: 'https://twitter.com/moeyua13/status/1665983183526195200', username: 'moeyua13', + source: 'https://unavatar.io/x/moeyua13', quote: <>I really love this terminal, }, { - tweetUrl: 'https://twitter.com/peterlazar1993/status/1689965895408402432', + url: 'https://twitter.com/peterlazar1993/status/1689965895408402432', username: 'peterlazar1993', + source: 'https://unavatar.io/x/peterlazar1993', quote: <>I've been dailydriving Rio, it's 🔥, }, { - tweetUrl: 'https://twitter.com/EduRonqui/status/1717288090820055297', + url: 'https://twitter.com/EduRonqui/status/1717288090820055297', username: 'EduRonqui', + source: 'https://unavatar.io/x/EduRonqui', quote: ( <> It’s a tiny one but this release features my first ever contribution to @@ -47,8 +62,9 @@ const MENTIONS = [ ), }, { - tweetUrl: 'https://twitter.com/EduRonqui/status/1730619921632022997', + url: 'https://x.com/ferfabricio/status/1789425980357886355', username: 'ferfabricio', + source: '/rio/assets/mentions/ferfabricio.jpg', quote: ( <> Eu comecei a usar o Rio term faz uns dias e ta sendo uma experiência @@ -56,6 +72,36 @@ const MENTIONS = [ ), }, + { + url: '#', + username: 'Jader Gomes', + source: '/rio/assets/mentions/jadergomes.jpg', + quote: ( + <> + Have been using Rio for few weeks and enjoying the experience so far. I love the colors and the visual around it. + + ), + }, + { + url: '#', + username: 'Daria Edlund', + source: '/rio/assets/mentions/dariaedlund.png', + quote: ( + <> + Installed Rio recently and am impressed how smooth and fast this terminal is. Already set up as my default go-to terminal! Looking forward to the continued development and what is to come. Keep up the awesome job Raphael! + + ), + }, + { + url: 'https://x.com/avelinorun/', + username: 'Thiago Avelino', + source: '/rio/assets/mentions/avelinorun.jpg', + quote: ( + <> + It is a privilege to be invited to beta test Rio! It has brought me closer to the code of the project, and I have learned a lot about how to develop a terminal emulator. + + ), + }, ]; export default MENTIONS; diff --git a/docs/static/assets/feature-icons/splits.svg b/docs/static/assets/feature-icons/splits.svg new file mode 100644 index 0000000000..c7a85b839d --- /dev/null +++ b/docs/static/assets/feature-icons/splits.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/docs/static/assets/mentions/avelinorun.jpg b/docs/static/assets/mentions/avelinorun.jpg new file mode 100644 index 0000000000..c91ea14772 Binary files /dev/null and b/docs/static/assets/mentions/avelinorun.jpg differ diff --git a/docs/static/assets/mentions/dariaedlund.png b/docs/static/assets/mentions/dariaedlund.png new file mode 100644 index 0000000000..2a7f953ef8 Binary files /dev/null and b/docs/static/assets/mentions/dariaedlund.png differ diff --git a/docs/static/assets/mentions/ferfabricio.jpg b/docs/static/assets/mentions/ferfabricio.jpg new file mode 100644 index 0000000000..ceac12cd6a Binary files /dev/null and b/docs/static/assets/mentions/ferfabricio.jpg differ diff --git a/docs/static/assets/mentions/jadergomes.jpg b/docs/static/assets/mentions/jadergomes.jpg new file mode 100644 index 0000000000..c6fbc4c340 Binary files /dev/null and b/docs/static/assets/mentions/jadergomes.jpg differ diff --git a/docs/static/assets/mentions/jaijams.jpg b/docs/static/assets/mentions/jaijams.jpg new file mode 100644 index 0000000000..9dfdb7d684 Binary files /dev/null and b/docs/static/assets/mentions/jaijams.jpg differ diff --git a/docs/static/assets/mentions/mcsmonte.jpg b/docs/static/assets/mentions/mcsmonte.jpg new file mode 100644 index 0000000000..e378db284e Binary files /dev/null and b/docs/static/assets/mentions/mcsmonte.jpg differ diff --git a/docs/static/assets/mentions/simonnyberg.png b/docs/static/assets/mentions/simonnyberg.png new file mode 100644 index 0000000000..6ee5bd61a6 Binary files /dev/null and b/docs/static/assets/mentions/simonnyberg.png differ diff --git a/frontends/rioterm/src/application.rs b/frontends/rioterm/src/application.rs index fe4db0ccb1..43d6f1e706 100644 --- a/frontends/rioterm/src/application.rs +++ b/frontends/rioterm/src/application.rs @@ -1,7 +1,6 @@ use crate::event::{ClickState, EventPayload, EventProxy, RioEvent, RioEventType}; use crate::ime::Preedit; -use crate::router::{RouteWindow, Router}; -use crate::routes::RoutePath; +use crate::router::{routes::RoutePath, Router}; use crate::scheduler::{Scheduler, TimerId, Topic}; use crate::screen::touch::on_touch; use crate::watcher::configuration_file_updates; @@ -116,17 +115,12 @@ impl ApplicationHandler for Application { return; } - let mut window = RouteWindow::new( + self.router.create_window( event_loop, - &self.event_proxy, + self.event_proxy.clone(), &self.config, - &self.router.font_library, None, - &self.router.clipboard, - ) - .unwrap(); - window.is_focused = true; - self.router.create_route_from_window(window); + ); tracing::info!("Initialisation complete"); } @@ -447,7 +441,7 @@ impl ApplicationHandler for Application { event_loop, self.event_proxy.clone(), &self.config, - Some(route.window.winit_window.tabbing_identifier()), + Some(&route.window.winit_window.tabbing_identifier()), None, ); @@ -578,7 +572,7 @@ impl ApplicationHandler for Application { active_event_loop, self.event_proxy.clone(), config, - tab_id.clone(), + tab_id.as_deref(), Some(url), ); } diff --git a/frontends/rioterm/src/main.rs b/frontends/rioterm/src/main.rs index ab035dc2ff..9c36a74e90 100644 --- a/frontends/rioterm/src/main.rs +++ b/frontends/rioterm/src/main.rs @@ -17,7 +17,6 @@ mod panic; mod platform; mod renderer; mod router; -mod routes; mod scheduler; mod screen; mod watcher; diff --git a/frontends/rioterm/src/router/mod.rs b/frontends/rioterm/src/router/mod.rs index d195a61e7a..75e038b00f 100644 --- a/frontends/rioterm/src/router/mod.rs +++ b/frontends/rioterm/src/router/mod.rs @@ -1,7 +1,7 @@ +pub mod routes; mod window; use crate::event::EventProxy; use crate::router::window::{configure_window, create_window_builder}; -use crate::routes::{assistant, RoutePath}; use crate::screen::{Screen, ScreenWindowProperties}; use assistant::Assistant; use raw_window_handle::{HasDisplayHandle, HasWindowHandle}; @@ -15,9 +15,9 @@ use rio_window::platform::startup_notify::{ self, EventLoopExtStartupNotify, WindowAttributesExtStartupNotify, }; use rio_window::window::{Window, WindowId}; +use routes::{assistant, RoutePath}; use std::cell::RefCell; use std::collections::HashMap; -use std::error::Error; use std::rc::Rc; pub struct Route { @@ -184,23 +184,6 @@ impl Router { } } - #[inline] - pub fn create_route_from_window(&mut self, route_window: RouteWindow) { - let id = route_window.winit_window.id(); - let mut route = Route { - window: route_window, - path: RoutePath::Terminal, - assistant: Assistant::new(), - }; - - if let Some(err) = &self.propagated_report { - route.report_error(err); - self.propagated_report = None; - } - - self.routes.insert(id, route); - } - pub fn open_config_window( &mut self, event_loop: &ActiveEventLoop, @@ -255,24 +238,36 @@ impl Router { config: &rio_backend::config::Config, open_url: Option, ) { + let tab_id = if config.navigation.is_native() { + Some(self.routes.len().to_string()) + } else { + None + }; + let window = RouteWindow::from_target( event_loop, event_proxy, config, &self.font_library, - "▲", - None, + RIO_TITLE, + tab_id.as_deref(), open_url, self.clipboard.clone(), ); - self.routes.insert( - window.winit_window.id(), - Route { - window, - path: RoutePath::Terminal, - assistant: Assistant::new(), - }, - ); + let id = window.winit_window.id(); + + let mut route = Route { + window, + path: RoutePath::Terminal, + assistant: Assistant::new(), + }; + + if let Some(err) = &self.propagated_report { + route.report_error(err); + self.propagated_report = None; + } + + self.routes.insert(id, route); } #[cfg(target_os = "macos")] @@ -282,7 +277,7 @@ impl Router { event_loop: &ActiveEventLoop, event_proxy: EventProxy, config: &rio_backend::config::Config, - tab_id: Option, + tab_id: Option<&str>, open_url: Option, ) { let window = RouteWindow::from_target( @@ -290,7 +285,7 @@ impl Router { event_proxy, config, &self.font_library, - "▲", + RIO_TITLE, tab_id, open_url, self.clipboard.clone(), @@ -306,6 +301,12 @@ impl Router { } } +// https://www.unicode.org/charts/PDF/Unicode-16.0/U160-1CC00.pdf +#[cfg(any(target_os = "macos", target_os = "windows"))] +const RIO_TITLE: &str = "𜱭𜱭"; +#[cfg(not(any(target_os = "macos", target_os = "windows")))] +const RIO_TITLE: &str = "▲"; + pub struct RouteWindow { pub is_focused: bool, pub is_occluded: bool, @@ -318,50 +319,6 @@ pub struct RouteWindow { } impl RouteWindow { - pub fn new( - event_loop: &ActiveEventLoop, - event_proxy: &EventProxy, - config: &rio_backend::config::Config, - font_library: &rio_backend::sugarloaf::font::FontLibrary, - open_url: Option, - clipboard: &Rc>, - ) -> Result> { - #[allow(unused_mut)] - let mut window_builder = create_window_builder("▲", config, None); - - let winit_window = event_loop.create_window(window_builder).unwrap(); - configure_window(&winit_window, config); - - let properties = ScreenWindowProperties { - size: winit_window.inner_size(), - scale: winit_window.scale_factor(), - raw_window_handle: winit_window.window_handle().unwrap().into(), - raw_display_handle: winit_window.display_handle().unwrap().into(), - window_id: winit_window.id(), - theme: winit_window.theme(), - }; - - let screen = Screen::new( - properties, - config, - event_proxy.clone(), - font_library, - open_url, - clipboard.clone(), - )?; - - Ok(Self { - is_focused: false, - is_occluded: false, - has_frame: true, - has_updates: true, - winit_window, - screen, - #[cfg(target_os = "macos")] - is_macos_deadzone: false, - }) - } - pub fn configure_window(&mut self, config: &rio_backend::config::Config) { configure_window(&self.winit_window, config); } @@ -373,13 +330,12 @@ impl RouteWindow { config: &RioConfig, font_library: &rio_backend::sugarloaf::font::FontLibrary, window_name: &str, - tab_id: Option, + tab_id: Option<&str>, open_url: Option, clipboard: Rc>, ) -> RouteWindow { #[allow(unused_mut)] - let mut window_builder = - create_window_builder(window_name, config, tab_id.clone()); + let mut window_builder = create_window_builder(window_name, config, tab_id); #[cfg(not(any(target_os = "macos", windows)))] if let Some(token) = event_loop.read_token_from_env() { diff --git a/frontends/rioterm/src/router/window/resources/images/rio-logo.ico b/frontends/rioterm/src/router/resources/images/rio-logo.ico similarity index 100% rename from frontends/rioterm/src/router/window/resources/images/rio-logo.ico rename to frontends/rioterm/src/router/resources/images/rio-logo.ico diff --git a/frontends/rioterm/src/routes/assistant.rs b/frontends/rioterm/src/router/routes/assistant.rs similarity index 100% rename from frontends/rioterm/src/routes/assistant.rs rename to frontends/rioterm/src/router/routes/assistant.rs diff --git a/frontends/rioterm/src/routes/dialog.rs b/frontends/rioterm/src/router/routes/dialog.rs similarity index 100% rename from frontends/rioterm/src/routes/dialog.rs rename to frontends/rioterm/src/router/routes/dialog.rs diff --git a/frontends/rioterm/src/routes/mod.rs b/frontends/rioterm/src/router/routes/mod.rs similarity index 100% rename from frontends/rioterm/src/routes/mod.rs rename to frontends/rioterm/src/router/routes/mod.rs diff --git a/frontends/rioterm/src/routes/welcome.rs b/frontends/rioterm/src/router/routes/welcome.rs similarity index 100% rename from frontends/rioterm/src/routes/welcome.rs rename to frontends/rioterm/src/router/routes/welcome.rs diff --git a/frontends/rioterm/src/router/window/mod.rs b/frontends/rioterm/src/router/window.rs similarity index 98% rename from frontends/rioterm/src/router/window/mod.rs rename to frontends/rioterm/src/router/window.rs index 553dee7c02..e1d2e73f9f 100644 --- a/frontends/rioterm/src/router/window/mod.rs +++ b/frontends/rioterm/src/router/window.rs @@ -18,7 +18,7 @@ pub const APPLICATION_ID: &str = "rio"; pub fn create_window_builder( title: &str, config: &Config, - #[allow(unused)] tab_id: Option, + #[allow(unused_variables)] tab_id: Option<&str>, ) -> WindowAttributes { let image_icon = image_rs::load_from_memory(LOGO_ICON).unwrap(); let icon = Icon::from_rgba( @@ -81,7 +81,7 @@ pub fn create_window_builder( if config.navigation.is_native() { if let Some(identifier) = tab_id { - window_builder = window_builder.with_tabbing_identifier(&identifier); + window_builder = window_builder.with_tabbing_identifier(identifier); } } else { window_builder = window_builder diff --git a/frontends/rioterm/src/screen/mod.rs b/frontends/rioterm/src/screen/mod.rs index 82e2abae2b..eb8cde962d 100644 --- a/frontends/rioterm/src/screen/mod.rs +++ b/frontends/rioterm/src/screen/mod.rs @@ -1887,21 +1887,24 @@ impl Screen<'_> { } } - pub fn render_assistant(&mut self, assistant: &crate::routes::assistant::Assistant) { + pub fn render_assistant( + &mut self, + assistant: &crate::router::routes::assistant::Assistant, + ) { self.sugarloaf.clear(); - crate::routes::assistant::screen(&mut self.sugarloaf, assistant); + crate::router::routes::assistant::screen(&mut self.sugarloaf, assistant); self.sugarloaf.render(); } pub fn render_welcome(&mut self) { self.sugarloaf.clear(); - crate::routes::welcome::screen(&mut self.sugarloaf); + crate::router::routes::welcome::screen(&mut self.sugarloaf); self.sugarloaf.render(); } pub fn render_dialog(&mut self, content: &str) { self.sugarloaf.clear(); - crate::routes::dialog::screen(&mut self.sugarloaf, content); + crate::router::routes::dialog::screen(&mut self.sugarloaf, content); self.sugarloaf.render(); }