fix(chat): ajustes de texto, layout e icone do menu
- Mudar texto 'Chat #' para 'Ticket #' no desktop - Passar ticketRef via URL para exibir numero correto - Ajustar tamanho da janela minimizada (240px) - Incluir ticketRef no checkMachineUpdates (Convex) - Ajustar padding dos botoes no chat web - Mudar icone 'Todos os tickets' para ClipboardList 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
3c2d1824fb
commit
d20ebf7416
8 changed files with 35 additions and 25 deletions
|
|
@ -70,6 +70,7 @@ pub struct ChatPollResponse {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ChatSessionSummary {
|
||||
pub ticket_id: String,
|
||||
pub ticket_ref: u64,
|
||||
pub unread_count: u32,
|
||||
pub last_activity_at: i64,
|
||||
}
|
||||
|
|
@ -923,7 +924,7 @@ async fn process_chat_update(
|
|||
if let Some(session) = current_sessions.first() {
|
||||
let label = format!("chat-{}", session.ticket_id);
|
||||
if app.get_webview_window(&label).is_none() {
|
||||
let _ = open_chat_window(app, &session.ticket_id);
|
||||
let _ = open_chat_window(app, &session.ticket_id, session.ticket_ref);
|
||||
// Minimizar imediatamente após abrir
|
||||
let _ = set_chat_minimized(app, &session.ticket_id, true);
|
||||
}
|
||||
|
|
@ -950,7 +951,7 @@ async fn process_chat_update(
|
|||
// WINDOW MANAGEMENT
|
||||
// ============================================================================
|
||||
|
||||
fn open_chat_window_internal(app: &tauri::AppHandle, ticket_id: &str) -> Result<(), String> {
|
||||
fn open_chat_window_internal(app: &tauri::AppHandle, ticket_id: &str, ticket_ref: u64) -> Result<(), String> {
|
||||
let label = format!("chat-{}", ticket_id);
|
||||
|
||||
// Verificar se ja existe
|
||||
|
|
@ -980,7 +981,7 @@ fn open_chat_window_internal(app: &tauri::AppHandle, ticket_id: &str) -> Result<
|
|||
};
|
||||
|
||||
// Usar query param ao inves de path para compatibilidade com SPA
|
||||
let url_path = format!("index.html?view=chat&ticketId={}", ticket_id);
|
||||
let url_path = format!("index.html?view=chat&ticketId={}&ticketRef={}", ticket_id, ticket_ref);
|
||||
|
||||
WebviewWindowBuilder::new(
|
||||
app,
|
||||
|
|
@ -989,7 +990,7 @@ fn open_chat_window_internal(app: &tauri::AppHandle, ticket_id: &str) -> Result<
|
|||
)
|
||||
.title("Chat de Suporte")
|
||||
.inner_size(380.0, 520.0)
|
||||
.min_inner_size(220.0, 52.0) // Tamanho minimo para modo minimizado com badge
|
||||
.min_inner_size(240.0, 52.0) // Tamanho minimo para modo minimizado com badge
|
||||
.position(x, y)
|
||||
.decorations(false) // Sem decoracoes nativas - usa header customizado
|
||||
.transparent(true) // Permite fundo transparente
|
||||
|
|
@ -1005,8 +1006,8 @@ fn open_chat_window_internal(app: &tauri::AppHandle, ticket_id: &str) -> Result<
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn open_chat_window(app: &tauri::AppHandle, ticket_id: &str) -> Result<(), String> {
|
||||
open_chat_window_internal(app, ticket_id)
|
||||
pub fn open_chat_window(app: &tauri::AppHandle, ticket_id: &str, ticket_ref: u64) -> Result<(), String> {
|
||||
open_chat_window_internal(app, ticket_id, ticket_ref)
|
||||
}
|
||||
|
||||
pub fn close_chat_window(app: &tauri::AppHandle, ticket_id: &str) -> Result<(), String> {
|
||||
|
|
@ -1032,7 +1033,7 @@ pub fn set_chat_minimized(app: &tauri::AppHandle, ticket_id: &str, minimized: bo
|
|||
|
||||
// Tamanhos - chip minimizado com margem extra para badge (absolute -top-1 -right-1)
|
||||
let (width, height) = if minimized {
|
||||
(220.0, 52.0) // Tamanho com folga para badge que fica fora do chip
|
||||
(240.0, 52.0) // Tamanho com folga para "Ticket #XXX" e badge
|
||||
} else {
|
||||
(380.0, 520.0) // Tamanho expandido
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue