feat(frontend): implementar paginacao numerada em listagens de tickets
- Adiciona tickets.listPaginated no backend com paginacao nativa Convex - Converte TicketsView para usePaginatedQuery com controles numerados - Converte PortalTicketList para usePaginatedQuery com controles numerados - Atualiza tauri e @tauri-apps/api para versao 2.9 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
91ac6c416c
commit
3396e930d4
10 changed files with 704 additions and 78 deletions
|
|
@ -13,7 +13,7 @@
|
|||
"dependencies": {
|
||||
"@radix-ui/react-scroll-area": "^1.2.3",
|
||||
"@radix-ui/react-tabs": "^1.1.13",
|
||||
"@tauri-apps/api": "^2",
|
||||
"@tauri-apps/api": "^2.9.1",
|
||||
"@tauri-apps/plugin-dialog": "^2.4.2",
|
||||
"@tauri-apps/plugin-opener": "^2",
|
||||
"@tauri-apps/plugin-process": "^2",
|
||||
|
|
|
|||
33
apps/desktop/src-tauri/Cargo.lock
generated
33
apps/desktop/src-tauri/Cargo.lock
generated
|
|
@ -4369,9 +4369,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tao"
|
||||
version = "0.34.3"
|
||||
version = "0.34.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "959469667dbcea91e5485fc48ba7dd6023face91bb0f1a14681a70f99847c3f7"
|
||||
checksum = "f3a753bdc39c07b192151523a3f77cd0394aa75413802c883a0f6f6a0e5ee2e7"
|
||||
dependencies = [
|
||||
"bitflags 2.9.4",
|
||||
"block2 0.6.2",
|
||||
|
|
@ -4437,9 +4437,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
|
|||
|
||||
[[package]]
|
||||
name = "tauri"
|
||||
version = "2.8.5"
|
||||
version = "2.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4d1d3b3dc4c101ac989fd7db77e045cc6d91a25349cd410455cb5c57d510c1c"
|
||||
checksum = "8a3868da5508446a7cd08956d523ac3edf0a8bc20bf7e4038f9a95c2800d2033"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
|
|
@ -4480,7 +4480,6 @@ dependencies = [
|
|||
"tokio",
|
||||
"tray-icon",
|
||||
"url",
|
||||
"urlpattern",
|
||||
"webkit2gtk",
|
||||
"webview2-com",
|
||||
"window-vibrancy",
|
||||
|
|
@ -4489,9 +4488,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tauri-build"
|
||||
version = "2.4.1"
|
||||
version = "2.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c432ccc9ff661803dab74c6cd78de11026a578a9307610bbc39d3c55be7943f"
|
||||
checksum = "17fcb8819fd16463512a12f531d44826ce566f486d7ccd211c9c8cebdaec4e08"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cargo_toml",
|
||||
|
|
@ -4511,9 +4510,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tauri-codegen"
|
||||
version = "2.4.0"
|
||||
version = "2.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ab3a62cf2e6253936a8b267c2e95839674e7439f104fa96ad0025e149d54d8a"
|
||||
checksum = "9fa9844cefcf99554a16e0a278156ae73b0d8680bbc0e2ad1e4287aadd8489cf"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"brotli",
|
||||
|
|
@ -4538,9 +4537,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tauri-macros"
|
||||
version = "2.4.0"
|
||||
version = "2.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4368ea8094e7045217edb690f493b55b30caf9f3e61f79b4c24b6db91f07995e"
|
||||
checksum = "3764a12f886d8245e66b7ee9b43ccc47883399be2019a61d80cf0f4117446fde"
|
||||
dependencies = [
|
||||
"heck 0.5.0",
|
||||
"proc-macro2",
|
||||
|
|
@ -4689,9 +4688,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tauri-runtime"
|
||||
version = "2.8.0"
|
||||
version = "2.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4cfc9ad45b487d3fded5a4731a567872a4812e9552e3964161b08edabf93846"
|
||||
checksum = "87f766fe9f3d1efc4b59b17e7a891ad5ed195fa8d23582abb02e6c9a01137892"
|
||||
dependencies = [
|
||||
"cookie",
|
||||
"dpi",
|
||||
|
|
@ -4714,9 +4713,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tauri-runtime-wry"
|
||||
version = "2.8.1"
|
||||
version = "2.9.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c1fe9d48bd122ff002064e88cfcd7027090d789c4302714e68fcccba0f4b7807"
|
||||
checksum = "187a3f26f681bdf028f796ccf57cf478c1ee422c50128e5a0a6ebeb3f5910065"
|
||||
dependencies = [
|
||||
"gtk",
|
||||
"http",
|
||||
|
|
@ -4741,9 +4740,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tauri-utils"
|
||||
version = "2.7.0"
|
||||
version = "2.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41a3852fdf9a4f8fbeaa63dc3e9a85284dd6ef7200751f0bd66ceee30c93f212"
|
||||
checksum = "76a423c51176eb3616ee9b516a9fa67fed5f0e78baaba680e44eb5dd2cc37490"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"brotli",
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ crate-type = ["staticlib", "cdylib", "rlib"]
|
|||
tauri-build = { version = "2.4.1", features = [] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "2.8.5", features = ["wry", "devtools", "tray-icon"] }
|
||||
tauri = { version = "2.9", features = ["wry", "devtools", "tray-icon"] }
|
||||
tauri-plugin-opener = "2.5.0"
|
||||
tauri-plugin-store = "2.4.0"
|
||||
tauri-plugin-updater = "2.9.0"
|
||||
|
|
|
|||
|
|
@ -34,17 +34,12 @@ type MachineUpdatePayload = {
|
|||
totalUnread: number
|
||||
}
|
||||
|
||||
type MessagesPayload = {
|
||||
messages: ChatMessage[]
|
||||
hasSession: boolean
|
||||
}
|
||||
|
||||
// Convex self-hosted exige o formato "module.js:function"
|
||||
const FN_CHECK_UPDATES = "liveChat.js:checkMachineUpdates" as const
|
||||
const FN_LIST_MESSAGES = "liveChat.js:listMachineMessages" as const
|
||||
const FN_POST_MESSAGE = "liveChat.js:postMachineMessage" as const
|
||||
const FN_MARK_READ = "liveChat.js:markMachineMessagesRead" as const
|
||||
const FN_UPLOAD_URL = "liveChat.js:generateMachineUploadUrl" as const
|
||||
// Nomes das functions no Convex (formato module:function)
|
||||
const FN_CHECK_UPDATES = "liveChat:checkMachineUpdates" as const
|
||||
const FN_LIST_MESSAGES = "liveChat:listMachineMessages" as const
|
||||
const FN_POST_MESSAGE = "liveChat:postMachineMessage" as const
|
||||
const FN_MARK_READ = "liveChat:markMachineMessagesRead" as const
|
||||
const FN_UPLOAD_URL = "liveChat:generateMachineUploadUrl" as const
|
||||
|
||||
async function loadStore(): Promise<MachineStoreData> {
|
||||
const appData = await appLocalDataDir()
|
||||
|
|
|
|||
|
|
@ -1106,7 +1106,14 @@ const resolvedAppUrl = useMemo(() => {
|
|||
|
||||
prevUnread = totalUnread
|
||||
},
|
||||
(err) => console.error("chat updates (Convex) erro:", err)
|
||||
(err) => {
|
||||
console.error("chat updates (Convex) erro:", err)
|
||||
const msg = (err?.message || "").toLowerCase()
|
||||
if (msg.includes("token de máquina") || msg.includes("revogado") || msg.includes("expirado") || msg.includes("inválido")) {
|
||||
// Token inválido/expirado no Convex → tenta autoregistrar de novo
|
||||
attemptSelfHeal("convex-subscribe").catch(console.error)
|
||||
}
|
||||
}
|
||||
).then((u) => {
|
||||
unsub = u
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue