refactor(bridge): split handlers.rs into modules

- handlers/mod.rs: public handler functions
- handlers/helpers.rs: utility functions (get_client, get_token, etc.)
- handlers/enrich.rs: post enrichment (display names, files)
- Fix FileInfo export in mm-core

feat(ui): preserve collapsed state on dashboard refresh

- Track collapsed team IDs in buffer-local mattermost--collapsed-teams
- Save collapse state before re-rendering (define-derived-mode resets locals)
- Restore collapse state after re-rendering
- Reset dashboard buffer on mattermost-reset-state
This commit is contained in:
Ivan I. Ovchinnikov
2026-11-21 12:13:57 +03:00
parent 452005b98c
commit b5777565d7
8 changed files with 359 additions and 157 deletions
+2 -1
View File
@@ -9,5 +9,6 @@ pub mod model;
pub use error::{BridgeError, ErrorKind};
pub use ids::{ChannelId, PostId, ServerId, TeamId, UserId};
pub use model::{
BridgeInfo, BridgeState, BridgeStatus, Channel, Post, ServerConfig, ServerSummary, Team, User,
BridgeInfo, BridgeState, BridgeStatus, Channel, FileInfo, Post, ServerConfig, ServerSummary,
Team, User,
};
+13
View File
@@ -93,6 +93,16 @@ pub struct Channel {
pub last_post_at: i64,
}
/// File metadata attached to a post.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FileInfo {
pub id: String,
pub name: String,
pub size: i64,
#[serde(default)]
pub mime_type: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Post {
pub id: PostId,
@@ -108,4 +118,7 @@ pub struct Post {
/// Populated by the bridge after resolving user_id via /users/ids.
#[serde(default, skip_deserializing)]
pub user_display_name: String,
/// Populated by the bridge after fetching file metadata.
#[serde(default, skip_deserializing)]
pub files: Vec<FileInfo>,
}