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

feat: Update dependencies #25

Merged
merged 4 commits into from
Aug 15, 2024
Merged
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
88 changes: 52 additions & 36 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ keywords = ["tui", "atproto", "bluesky", "atrium"]
exclude = ["/config"]

[dependencies]
bsky-sdk = "0.1.6"
bsky-sdk = "0.1.7"
chrono = { version = "0.4.38", default-features = false }
clap = { version = "4.5.8", features = ["derive"] }
color-eyre = "0.6.3"
crossterm = { version = "0.27.0", features = ["event-stream", "serde"] }
crossterm = { version = "0.28.1", features = ["event-stream", "serde"] }
directories = "5.0.1"
env_logger = "0.11.3"
futures-util = "0.3.30"
image = { version = "0.25.2", default-features = false, features = ["jpeg", "png"] }
indexmap = "2.2.6"
log = "0.4.22"
open = "5.2.0"
ratatui = "0.27"
ratatui = "0.28"
regex = "1.10.6"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.117"
Expand All @@ -36,7 +36,7 @@ tokio = { version = "1.38.0", features = [
"time",
] }
toml = "0.8.14"
tui-textarea = "0.5.1"
tui-textarea = "0.6.1"

[dev-dependencies]
ipld-core = "0.4.0"
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
- [x] Auto refresh rows
- [x] Auto save & restore app data
- [x] Post texts
- [x] Embed images
- [x] Embed record
- [ ] Embed external links
- [ ] Reply to post
- [ ] Notifications, Chat, ...
- [x] Configure with files
- [ ] ... and more
Expand Down
5 changes: 3 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ impl App {
Action::Render => {
tui.draw(|f| {
// render main components to the left side
if let Err(e) = main_component.draw(f, f.size()) {
if let Err(e) = main_component.draw(f, f.area()) {
action_tx
.send(Action::Error(format!("failed to draw: {e}")))
.ok();
}
for component in self.components.iter_mut() {
if let Err(e) = component.draw(f, f.size()) {
if let Err(e) = component.draw(f, f.area()) {
action_tx
.send(Action::Error(format!("failed to draw: {e}")))
.ok();
Expand Down Expand Up @@ -123,6 +123,7 @@ impl App {
return Some(action);
}
}
Event::Error(e) => log::error!("Event::Error: {e}"),
_ => {}
}
None
Expand Down
1 change: 1 addition & 0 deletions src/backend/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use bsky_sdk::api::app::bsky::graph::defs::ListView;

#[derive(Debug, Clone)]
pub struct PinnedFeed {
#[allow(dead_code)]
pub saved_feed: SavedFeed,
pub info: FeedSourceInfo,
}
Expand Down
9 changes: 2 additions & 7 deletions src/backend/watches/feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,7 @@ mod tests {
use super::*;
use bsky_sdk::api::app::bsky::actor::defs::{ProfileViewBasic, ProfileViewBasicData};
use bsky_sdk::api::app::bsky::feed::defs::{FeedViewPostData, PostViewData, ReasonRepostData};
use bsky_sdk::api::records::Record;
use bsky_sdk::api::types::{string::Datetime, UnknownData};
use ipld_core::ipld::Ipld;
use bsky_sdk::api::types::{string::Datetime, Unknown};
use std::collections::BTreeMap;

fn feed_view_post(cid: Cid, reason_indexed_at: Option<Datetime>) -> FeedViewPost {
Expand All @@ -304,10 +302,7 @@ mod tests {
indexed_at: Datetime::now(),
labels: None,
like_count: None,
record: Record::Unknown(UnknownData {
r#type: "post".to_string(),
data: Ipld::Map(BTreeMap::new()),
}),
record: Unknown::Object(BTreeMap::new()),
reply_count: None,
repost_count: None,
threadgate: None,
Expand Down
5 changes: 3 additions & 2 deletions src/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use crate::config::Config;
use crate::types::{Action, Event};
use color_eyre::eyre::Result;
use crossterm::event::{KeyEvent, MouseEvent};
use ratatui::{layout::Rect, Frame};
use ratatui::layout::{Rect, Size};
use ratatui::Frame;
use tokio::sync::mpsc::UnboundedSender;

/// `Component` is a trait that represents a visual and interactive element of the user interface.
Expand Down Expand Up @@ -50,7 +51,7 @@ pub trait Component {
///
/// * `Result<()>` - An Ok result or an error.
#[allow(unused_variables)]
fn init(&mut self, area: Rect) -> Result<()> {
fn init(&mut self, size: Size) -> Result<()> {
Ok(())
}
/// Handle incoming events and produce actions if necessary.
Expand Down
5 changes: 3 additions & 2 deletions src/components/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ use bsky_sdk::api::agent::Session;
use bsky_sdk::BskyAgent;
use color_eyre::{eyre, Result};
use crossterm::event::KeyEvent;
use ratatui::{layout::Rect, Frame};
use ratatui::layout::{Rect, Size};
use ratatui::Frame;
use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::{Arc, RwLock};
use tokio::sync::mpsc::{self, UnboundedSender};
Expand Down Expand Up @@ -150,7 +151,7 @@ impl ColumnComponent {
}

impl Component for ColumnComponent {
fn init(&mut self, _area: Rect) -> Result<()> {
fn init(&mut self, _size: Size) -> Result<()> {
self.views = vec![Box::new(LoginComponent::new(self.view_tx.clone()))];
Ok(())
}
Expand Down
Loading