Skip to content

fix(ui,sessions,usage): reset tab scroll, support direct session deletion, and show token counts in usage breakdowns - #541

Open
jianli9158 wants to merge 1 commit into
router-for-me:devfrom
jianli9158:fix/p0-issues-534-540-511
Open

jianli9158 wants to merge 1 commit into
router-for-me:devfrom
jianli9158:fix/p0-issues-534-540-511

Conversation

@jianli9158

Copy link
Copy Markdown

Summary

This PR resolves three high-priority UX and functionality issues (#534, #540, and #511):

  1. Reset scroll position across tab and subpage transitions (Fixes Scroll position persists across tab changes, leaving non-scrollable views cut off #534)

    • Adds resetWorkspaceScroll() in src/navigation.ts and invokes it across top-level page transitions (src/App.tsx) and subpage tab changes (src/pages/ConfigPanel.tsx, src/pages/ManagementPages.tsx).
    • Clamps non-scrollable shell ancestors (.immersive-window, .window-content, .app-shell, document.documentElement, document.body) after setting-search scrollIntoView() calls so non-scrollable views are never stuck at an inherited vertical offset.
  2. Constrain Codex session delete dialog height & support permanent deletion without backup (Fixes 会话删除 #540)

    • Caps .codex-session-dialog height (max-height: min(560px, calc(100vh - 40px))) and makes long session descriptions vertically scrollable (max-height: min(240px, calc(100vh - 250px)); overflow-y: auto), keeping the confirmation actions visible inside the viewport even for multi-paragraph session titles.
    • Adds an optional skipBackup flag to DeleteCodexSessionsRequest (src-tauri/src/codex_sessions.rs, src/services/codexSessions.ts, and src/mocks/browserMockRuntime.ts) and a Delete directly without creating a backup checkbox in src/pages/CodexSessionsPanel.tsx (localized across en, zh-CN, zh-TW, and ja).
  3. Display token usage alongside request counts in Usage Analysis breakdowns (Fixes 分析统计使用情况,改版后按密钥统计列表只有调用次数,没有token #511)

    • Updates CategorySummary in src/pages/UsageAnalysisView.tsx and src/pages/UsageAnalysisView.css so both the summary caption and expanded list rows for Source and Key display token consumption ({tokens} Token) alongside request counts.

Verification

  • bun run check (tsc --noEmit) passes with zero errors.
  • bun test tests/navigationAndUpdate.test.ts tests/i18n.test.ts tests/binaryControls.test.tsx tests/surfaceControls.test.ts tests/cssSyntax.test.ts tests/browserMockRuntime.test.ts passes.
  • Verified in headless Chromium across Advanced Features -> Quota / Home scroll transitions, Usage -> Analysis source/key breakdowns, and Agent Configuration -> Codex -> Session Management delete confirmation modal with long session titles.

…tion, and show token counts in usage breakdowns
@github-actions

Copy link
Copy Markdown
Contributor

This pull request targeted main.

The base branch has been automatically changed to dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant