Skip to content

feat(dashboard/logs): add fullscreen mode#632

Merged
ding113 merged 6 commits intodevfrom
feat/dashboard-logs-fullscreen
Jan 20, 2026
Merged

feat(dashboard/logs): add fullscreen mode#632
ding113 merged 6 commits intodevfrom
feat/dashboard-logs-fullscreen

Conversation

@ding113
Copy link
Owner

@ding113 ding113 commented Jan 20, 2026

Summary

Add fullscreen mode support for the dashboard usage logs page. This feature allows users to view logs in an immersive fullscreen overlay with real-time metrics (concurrent sessions, today's requests, cost, and response time).

Problem

When monitoring usage logs on the dashboard, users may want a distraction-free, maximized view to focus on log analysis, especially during active monitoring or debugging sessions. The existing logs table view is embedded within the dashboard layout with limited vertical space.

Solution

Introduce a fullscreen overlay mode for the usage logs table with:

  1. Fullscreen Hook (src/hooks/use-fullscreen.ts)

    • Reusable hook wrapping the Fullscreen API
    • Handles browser compatibility and state management
    • Supports enter/exit with ESC key handling
  2. Fullscreen Overlay UI (usage-logs-view-virtualized.tsx)

    • Fixed overlay with real-time metrics header (concurrent sessions, requests, cost, response time)
    • Auto-refresh at 3s intervals in fullscreen mode
    • Collapsible settings panel for toggling provider column visibility
    • Respects ESC key and external fullscreen exit
  3. Enhanced VirtualizedLogsTable (virtualized-logs-table.tsx)

    • New props: hideStatusBar, hideScrollToTop, hiddenColumns, bodyClassName
    • Supports hiding provider column in fullscreen mode for wider horizontal space

Changes

Core Changes

File Change
src/hooks/use-fullscreen.ts New reusable fullscreen hook
src/app/[locale]/dashboard/logs/_components/usage-logs-view-virtualized.tsx Fullscreen overlay with metrics header
src/app/[locale]/dashboard/logs/_components/virtualized-logs-table.tsx Props for hiding status bar, scroll-to-top, and columns

i18n Updates

File Change
messages/{en,ja,ru,zh-CN,zh-TW}/dashboard.json Added fullscreen, exitFullscreen, hideProviderColumn, showProviderColumn strings

Tests

File Change
tests/unit/dashboard-logs-fullscreen-overlay-ui.test.tsx New test suite for fullscreen overlay
src/app/[locale]/dashboard/logs/_components/virtualized-logs-table.test.tsx Added test for hiddenColumns prop

Other

File Change
src/app/v1/_lib/codex/chat-completions-handler.ts Import reorder (Biome)
src/app/v1/_lib/proxy-handler.ts Import reorder (Biome)
src/app/v1/_lib/proxy/error-handler.ts Import reorder (Biome)

Testing

Automated Tests

  • Unit tests added for fullscreen overlay UI
  • Unit tests added for hiddenColumns prop

Manual Testing

  1. Navigate to /dashboard/logs
  2. Click "Fullscreen" button in the table header
  3. Verify fullscreen mode activates with metrics header
  4. Toggle "Hide Provider Column" switch and verify column visibility
  5. Press ESC or click "Exit Fullscreen" to exit
  6. Verify state resets correctly

Pre-commit Verification

bun run build      # Production build
bun run lint       # Biome check
bun run typecheck  # TypeScript check
bun run test       # Vitest tests

Checklist

  • Code follows project conventions
  • Self-review completed
  • Tests pass locally
  • i18n strings added for all 5 supported languages
  • No breaking changes

Description enhanced by Claude AI

ding113 and others added 5 commits January 20, 2026 15:48
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

在仪表板日志视图中添加全屏模式与提供商列可见性控制:新增本地化键、引入客户端全屏Hook、扩展虚拟化日志表组件的可配置props、在使用视图中实现全屏叠加层与概览数据抓取,并补充相关单元/集成测试与若干导入整理。

Changes

Cohort / File(s) 变更摘要(需关注点)
翻译文件
messages/en/dashboard.json, messages/ja/dashboard.json, messages/ru/dashboard.json, messages/zh-CN/dashboard.json, messages/zh-TW/dashboard.json
新增4个本地化键:hideProviderColumnshowProviderColumnfullscreenexitFullscreen(注意多语言键一致性与 JSON 逗号/语法)
虚拟化日志表组件
src/app/[locale]/dashboard/logs/_components/virtualized-logs-table.tsx
新增 public props: hideStatusBar?hideScrollToTop?hiddenColumns?bodyClassName?;添加类型 VirtualizedLogsTableColumn = "provider" 并基于 hiddenColumns 条件渲染 provider 列与状态栏(注意 props 接口变更与消费处兼容性)
UsageLogs 视图(全屏/概览)
src/app/[locale]/dashboard/logs/_components/usage-logs-view-virtualized.tsx
大量新增:全屏状态与进入/退出处理、overview 数据拉取与定时重试、全屏叠加层 UI(包含指标条、操作按钮、隐藏提供商列浮动面板)、键盘 Escape 关闭逻辑(注意数据获取时序、定时器/订阅清理及无障碍/聚焦管理)
全屏 Hook
src/hooks/use-fullscreen.ts
新增客户端 Hook 与导出接口 FullscreenController:检测支持性、跟踪 isFullscreen、提供 requestexit 方法(注意 SSR 环境防护与事件解绑)
测试:虚拟表格 / 全屏覆盖层
src/app/[locale]/dashboard/logs/_components/virtualized-logs-table.test.tsx, tests/unit/dashboard-logs-fullscreen-overlay-ui.test.tsx
新增测试:验证 provider 列通过 hiddenColumns 隐藏,验证 UsageLogs 全屏覆盖层打开/关闭、隐藏列切换与交互(注意测试的 mock 覆盖与与真实实现的一致性)
导入整理(小幅变更)
src/app/v1/_lib/codex/chat-completions-handler.ts, src/app/v1/_lib/proxy-handler.ts, src/app/v1/_lib/proxy/error-handler.ts
调整/去重 attachSessionIdToErrorResponse 的 import 位置,未改动运行逻辑(注意避免引入循环或路径错误)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Fix/logs provider badge overflow #581:修改仪表板日志表格与提供商列渲染相关代码,与本PR中对 provider 列可见性和日志表渲染逻辑的改动高度相关。
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'feat(dashboard/logs): add fullscreen mode' accurately and concisely describes the main feature being added - fullscreen functionality for dashboard logs, which aligns with the extensive changes across UI components, translations, and tests.
Description check ✅ Passed The PR description is comprehensive and directly related to the changeset, detailing the fullscreen mode implementation, affected files, testing approach, and providing clear context for the changes made across components and i18n files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/dashboard-logs-fullscreen

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ding113, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the user experience of the dashboard's usage logs by implementing a new fullscreen mode. This mode provides an immersive environment for reviewing log data, complete with real-time metrics and the ability to dynamically adjust column visibility. The feature is built upon a new, reusable React hook for managing fullscreen state and includes comprehensive internationalization support.

Highlights

  • Fullscreen Mode for Usage Logs: Introduced a dedicated fullscreen view for dashboard usage logs, improving focus and data visibility.
  • Reusable useFullscreen Hook: Developed a new, reusable React hook (useFullscreen) to encapsulate browser Fullscreen API logic.
  • Dynamic Column Visibility: Added the ability to hide/show the 'Provider' column within the fullscreen log table for better customization.
  • Internationalization Support: Included new translation strings across multiple languages for the fullscreen UI elements.
  • Minor Formatting Fixes: Applied import reordering in v1 API handlers for code consistency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Contributor

🧪 测试结果

测试类型 状态
代码质量
单元测试
集成测试
API 测试

总体结果: ✅ 所有测试通过

@github-actions github-actions bot added size/L Large PR (< 1000 lines) enhancement New feature or request area:UI area:i18n labels Jan 20, 2026
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a fullscreen mode for the dashboard's usage logs, which is a great enhancement for monitoring. The implementation includes a new reusable useFullscreen hook, updates to the virtualized table to support new display options, and new UI elements for entering and controlling the fullscreen view. The code is well-structured, and the new feature is covered by tests. I have one suggestion to refactor some duplicated state management logic to improve maintainability.

Comment on lines 202 to 222
const handleExitFullscreen = useCallback(async () => {
setIsFullscreenOpen(false);
setHideProviderColumn(false);
wasInFullscreenRef.current = false;
await fullscreen.exit();
}, [fullscreen]);

useEffect(() => {
if (!isFullscreenOpen) return;

if (fullscreen.isFullscreen) {
wasInFullscreenRef.current = true;
return;
}

if (wasInFullscreenRef.current) {
setIsFullscreenOpen(false);
setHideProviderColumn(false);
wasInFullscreenRef.current = false;
}
}, [fullscreen.isFullscreen, isFullscreenOpen]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic for resetting the fullscreen state is duplicated in handleExitFullscreen and the useEffect that handles native fullscreen exit. To improve maintainability and avoid redundancy, you could extract this state reset logic into a separate useCallback function.

  const resetFullscreenState = useCallback(() => {
    setIsFullscreenOpen(false);
    setHideProviderColumn(false);
    wasInFullscreenRef.current = false;
  }, []);

  const handleExitFullscreen = useCallback(async () => {
    resetFullscreenState();
    await fullscreen.exit();
  }, [fullscreen, resetFullscreenState]);

  useEffect(() => {
    if (!isFullscreenOpen) return;

    if (fullscreen.isFullscreen) {
      wasInFullscreenRef.current = true;
      return;
    }

    if (wasInFullscreenRef.current) {
      resetFullscreenState();
    }
  }, [fullscreen.isFullscreen, isFullscreenOpen, resetFullscreenState]);

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

This PR adds fullscreen mode support for the dashboard usage logs page. The implementation is well-structured overall, but I've identified one issue that should be addressed.

PR Size: L

  • Lines changed: 886 (682 additions + 204 deletions)
  • Files changed: 13

Issues Found

Category Critical High Medium Low
Logic/Bugs 0 0 0 0
Security 0 0 0 0
Error Handling 0 1 0 0
Types 0 0 0 0
Comments/Docs 0 0 0 0
Tests 0 0 0 0
Simplification 0 0 0 0

High Priority Issues (Should Fix)

[ERROR-SILENT] Silent error suppression in fullscreen request handler

File: src/app/[locale]/dashboard/logs/_components/usage-logs-view-virtualized.tsx
Location: Lines 195-201 (in diff context)

The catch block suppresses errors from fullscreen.request() without logging or providing user feedback:

try {
  await fullscreen.request(document.documentElement);
} catch {
  return;
}

Why this is a problem: If fullscreen fails (permissions denied, browser restrictions, iframes, etc.), the user receives no indication that their action didn't work. The UI will appear unresponsive.

Suggested fix:

try {
  await fullscreen.request(document.documentElement);
} catch (error) {
  console.error("Failed to enter fullscreen:", error);
  // Optionally show a toast notification to the user
  return;
}

Review Coverage

  • Logic and correctness - Clean
  • Security (OWASP Top 10) - Clean
  • Error handling - 1 issue found
  • Type safety - Clean
  • Documentation accuracy - Clean
  • Test coverage - Adequate
  • Code clarity - Good

Notes

  1. i18n compliance: All user-facing strings properly use next-intl translations for all 5 supported languages.
  2. Test coverage: Unit tests are provided for the fullscreen overlay UI and hiddenColumns prop.
  3. Hook design: The useFullscreen hook is well-designed and handles SSR gracefully with typeof document checks.
  4. State management: The wasInFullscreenRef pattern correctly handles external fullscreen exit (via ESC key pressed at browser level).

Automated review by Claude AI


try {
await fullscreen.request(document.documentElement);
} catch {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[CRITICAL] [ERROR-SWALLOWED] Fullscreen request errors are swallowed silently\n\nFile: src/app/[locale]/dashboard/logs/_components/usage-logs-view-virtualized.tsx:195\n\nEvidence: } catch { immediately returns without logging or user feedback.\n\nWhy this is a problem: Element.requestFullscreen() can reject (permission/user-gesture/browser policy). Swallowing the error makes the feature fail with no signal and is very hard to debug.\n\nSuggested fix:\n\ntsx\nimport { toast } from "sonner";\n\nconst handleEnterFullscreen = useCallback(async () => {\n if (!fullscreen.supported) return;\n\n wasInFullscreenRef.current = false;\n\n try {\n await fullscreen.request(document.documentElement);\n setIsFullscreenOpen(true);\n } catch (error) {\n console.error(error);\n toast.error(t("logs.error.fullscreenFailed"));\n }\n}, [fullscreen, t]);\n\n\nAlso add logs.error.fullscreenFailed to messages/*/dashboard.json.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

This PR adds a fullscreen overlay to dashboard usage logs (new useFullscreen hook, table customization props, and locale strings). One new error-handling path silently swallows fullscreen request failures, making the feature no-op with no signal.

PR Size: L

  • Lines changed: 886
  • Files changed: 13
  • Split suggestions: Separate the unrelated v1 import-reorder changes (src/app/v1/_lib/*) into a standalone PR to keep this UI feature-focused.

Issues Found

Category Critical High Medium Low
Logic/Bugs 0 0 0 0
Security 0 0 0 0
Error Handling 1 0 0 0
Types 0 0 0 0
Comments/Docs 0 0 0 0
Tests 0 0 0 0
Simplification 0 0 0 0

Critical Issues (Must Fix)

  • [CRITICAL] [ERROR-SWALLOWED] src/app/[locale]/dashboard/logs/_components/usage-logs-view-virtualized.tsx:195 swallows requestFullscreen() failures (catch { return; }) without logging or user feedback. Confidence: 95.

High Priority Issues (Should Fix)

  • None.

Review Coverage

  • Logic and correctness
  • Security (OWASP Top 10)
  • Error handling
  • Type safety
  • Documentation accuracy
  • Test coverage
  • Code clarity

Automated review by Codex AI

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Identified PR #632 and applied size label size/L (886 lines changed across 13 files).
  • Posted 1 inline review comment: [CRITICAL] [ERROR-SWALLOWED] silent fullscreen failure handling at src/app/[locale]/dashboard/logs/_components/usage-logs-view-virtualized.tsx:195 (suggested logging + user-facing toast using i18n).
  • Submitted the full review summary via gh pr review --comment.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@github-actions
Copy link
Contributor

🧪 测试结果

测试类型 状态
代码质量
单元测试
集成测试
API 测试

总体结果: ✅ 所有测试通过

@ding113 ding113 merged commit 2d6dcb2 into dev Jan 20, 2026
8 of 9 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in Claude Code Hub Roadmap Jan 20, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/app/`[locale]/dashboard/logs/_components/usage-logs-view-virtualized.tsx:
- Around line 203-206: Replace the generic load-failed i18n key with a
fullscreen-specific key in the catch block inside UsageLogsViewVirtualized (the
catch that currently calls t("logs.error.loadFailed")); change it to use
t("logs.error.fullscreenFailed") and add the corresponding translation entries
("logs.error.fullscreenFailed") to each
messages/{en,ja,ru,zh-CN,zh-TW}/dashboard.json so the toast shows a clear
"failed to enter fullscreen" message in all supported locales.
🧹 Nitpick comments (2)
src/app/[locale]/dashboard/logs/_components/usage-logs-view-virtualized.tsx (2)

178-184: 建议为 overview 数据加载失败添加用户反馈。

fetchOverviewData 失败时,界面会静默显示 0 值(通过 overviewData?.concurrentSessions ?? 0 等),用户无法区分"数据真的为 0"还是"加载失败"。

考虑使用 onError 回调或检查 isError 状态来提示用户:

♻️ 建议的改进
 const { data: overviewData } = useQuery<OverviewData>({
   queryKey: ["overview-data"],
   queryFn: fetchOverviewData,
   enabled: isFullscreenOpen,
   refetchInterval: isFullscreenOpen ? 3000 : false,
   refetchOnWindowFocus: false,
+  meta: {
+    errorMessage: t("logs.error.loadFailed"),
+  },
 });

或在查询失败时显示 toast 提示。


432-443: 全屏视图的 VirtualizedLogsTable 配置正确。

autoRefreshEnabled={true}autoRefreshIntervalMs={3000} 确保全屏模式下数据实时更新。hiddenColumnshideProviderColumn 状态正确联动。

关于 Line 442 的高度计算 h-[calc(100vh-56px-32px-40px)],建议添加注释说明各数值含义以提高可维护性:

// 56px: header height, 32px: padding (p-4 * 2), 40px: bottom margin/buffer
bodyClassName="h-[calc(100vh-56px-32px-40px)]"

Comment on lines +203 to +206
} catch (error) {
console.error("[UsageLogsViewVirtualized] Failed to enter fullscreen", error);
toast.error(t("logs.error.loadFailed"));
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

使用了错误的 i18n 键来提示全屏请求失败。

当前使用 t("logs.error.loadFailed") 作为全屏请求失败的提示消息,但这是一个通用的"加载失败"消息,不够明确。结合 PR 提交信息 "surface fullscreen request failures",应使用专门的全屏错误消息。

🔧 建议的修复
    } catch (error) {
      console.error("[UsageLogsViewVirtualized] Failed to enter fullscreen", error);
-     toast.error(t("logs.error.loadFailed"));
+     toast.error(t("logs.error.fullscreenFailed"));
    }

同时需要在 messages/{en,ja,ru,zh-CN,zh-TW}/dashboard.json 中添加对应的 i18n 键:

{
  "logs": {
    "error": {
      "fullscreenFailed": "无法进入全屏模式"
    }
  }
}
🤖 Prompt for AI Agents
In `@src/app/`[locale]/dashboard/logs/_components/usage-logs-view-virtualized.tsx
around lines 203 - 206, Replace the generic load-failed i18n key with a
fullscreen-specific key in the catch block inside UsageLogsViewVirtualized (the
catch that currently calls t("logs.error.loadFailed")); change it to use
t("logs.error.fullscreenFailed") and add the corresponding translation entries
("logs.error.fullscreenFailed") to each
messages/{en,ja,ru,zh-CN,zh-TW}/dashboard.json so the toast shows a clear
"failed to enter fullscreen" message in all supported locales.

@coderabbitai coderabbitai bot mentioned this pull request Jan 20, 2026
9 tasks
ding113 added a commit that referenced this pull request Jan 20, 2026
* fix: 清理 usage-doc / big-screen i18n 硬编码 + 修复 Next.js params Promise 报错

* feat(leaderboard): add user tag and group filters for user ranking (#607)

* feat(leaderboard): add user tag and group filters for user ranking (#606)

Add filtering capability to the leaderboard user ranking by:
- userTags: filter users by their tags (OR logic)
- userGroups: filter users by their providerGroup (OR logic)

Changes:
- Repository: Add UserLeaderboardFilters interface and SQL filtering
- Cache: Extend LeaderboardFilters and include filters in cache key
- API: Parse userTags/userGroups query params (CSV format, max 20)
- Frontend: Add TagInput filters (admin-only, user scope only)
- i18n: Add translation keys for 5 languages

Closes #606

* refactor: apply reviewer suggestions for leaderboard filters

- Use JSONB ? operator instead of @> for better performance
- Extract parseListParam helper to reduce code duplication

* feat(leaderboard): add tag/group suggestions dropdown for better UX

- Fetch all user tags and groups via getAllUserTags/getAllUserKeyGroups
- Pass suggestions to TagInput for autocomplete dropdown
- Validate input against available suggestions
- Consistent with /dashboard/users filter behavior

* docs: update Privnode offer details in README files

* fix: 修复 1M 上下文标头兼容问题

* fix: resolve container name conflicts in multi-user environments (#625)

* fix: resolve container name conflicts in multi-user environments

- Add top-level `name` field with COMPOSE_PROJECT_NAME env var support
- Remove hardcoded container_name from all services
- Users can now set COMPOSE_PROJECT_NAME in .env for complete isolation

Closes #624

* fix: add top-level name field for project isolation

Add `name: ${COMPOSE_PROJECT_NAME:-claude-code-hub}` to enable
complete project isolation via environment variable.

* feat(dashboard): improve user management, statistics reset, and i18n (#610)

* fix(dashboard/logs): add reset options to filters and use short time format

- Add "All keys" SelectItem to API Key filter dropdown
- Add "All status codes" SelectItem to Status Code filter dropdown
- Use __all__ value instead of empty string (Radix Select requirement)
- Add formatDateDistanceShort() for compact time display (2h ago, 3d ago)
- Update RelativeTime component to use short format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(providers): add Auto Sort button to dashboard and fix i18n

- Add AutoSortPriorityDialog to dashboard/providers page
- EN: "Auto Sort Priority" -> "Auto Sort"
- RU: "Авто сортировка приоритета" -> "Автосорт"
- RU: "Добавить провайдера" -> "Добавить поставщика"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(i18n): improve Russian localization and fix login errors

Russian localization improvements:
- Menu: "Управление поставщиками" -> "Поставщики"
- Menu: "Доступность" -> "Мониторинг"
- Filters: "Последние 7/30 дней" -> "7д/30д"
- Dashboard: "Статистика использования" -> "Статистика"
- Dashboard: "Показать статистику..." -> "Только ваши ключи"
- Quota: add missing translations (manageNotice, withQuotas, etc.)

Login error localization:
- Fix issue where login errors displayed in Chinese ("无效或已过期") regardless of locale
- Add locale detection from NEXT_LOCALE cookie and Accept-Language header
- Add 3 new error keys: apiKeyRequired, apiKeyInvalidOrExpired, serverError
- Support all 5 languages: EN, JA, RU, ZH-CN, ZH-TW
- Remove product name from login privacyNote for all locales

Files changed:
- messages/*/auth.json: new error keys, update privacyNote
- messages/ru/dashboard.json, messages/ru/quota.json: Russian improvements
- src/app/api/auth/login/route.ts: add getLocaleFromRequest()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat(dashboard/users): improve user management with key quotas and tokens

- Add access/model restrictions support (allowedClients/allowedModels)
- Add tokens column and refresh button to users table
- Add todayTokens calculation in repository layer (sum all token types)
- Add visual status indicators with color-coded icons (active/disabled/expiring/expired)
- Allow users to view their own key quota (was admin-only)
- Fix React Query cache invalidation on status toggle
- Fix filter logic: change tag/keyGroup from OR to AND
- Refactor time display: move formatDateDistanceShort to component with i18n
- Add fixed header/footer to key dialogs for better UX

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat(dashboard/users): add reset statistics with optimized Redis pipeline

- Implement reset all statistics functionality for admins
- Optimize Redis operations: replace sequential redis.keys() with parallel SCAN
- Add scanPattern() helper for production-safe key scanning
- Comprehensive error handling and performance metrics logging
- 50-100x performance improvement with no Redis blocking

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(lint): apply biome formatting and fix React hooks dependencies

- Fix useEffect dependencies in RelativeTime component (wrap formatShortDistance in useCallback)
- Remove unused effectiveGroupText variable in key-row-item.tsx
- Apply consistent LF line endings across modified files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: address code review feedback from PR #610

- Remove duplicate max-h class in edit-key-dialog.tsx (keep max-h-[90dvh] only)
- Add try-catch fallback for getTranslations in login route catch block

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: translate Russian comments to English for consistency

Addresses Gemini Code Assist review feedback.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(users): add unit tests for resetUserAllStatistics function

Cover all requirement scenarios:
- Permission check (admin-only)
- User not found handling
- Success path with DB + Redis cleanup
- Redis not ready graceful handling
- Redis partial failure warning
- scanPattern failure warning
- pipeline.exec failure error logging
- Unexpected error handling
- Empty keys list handling

10 test cases with full mock coverage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: John Doe <johndoe@example.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* feat(my-usage): cache statistics and timezone fixes (#623)

* feat(my-usage): add cache token statistics to model breakdown

Add cacheCreationTokens and cacheReadTokens fields to ModelBreakdownItem
interface and related DB queries for displaying cache statistics in the
statistics summary card modal.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(my-usage): use configured timezone for date filtering

Use server timezone (TZ config) instead of browser locale when:
- Filtering statistics by date (getMyStatsSummary)
- Calculating daily quota time ranges (getTimeRangeForPeriod)

This ensures consistent date interpretation across different client
timezones. Fixes discrepancy between Daily Quota and Statistics
Summary when user is in a different timezone than the server.

Added comprehensive unit tests covering:
- Date parsing in configured timezone
- Timezone offset calculations
- Day boundary edge cases

* refactor(my-usage): clean up expiration displays

Remove duplicate expiration information:
- Remove Key Expires chip from Welcome header (keep User Expires only)
- Remove "Expiring Soon" warning block from Quota Usage cards

Improve countdown display in ExpirationInfo component:
- Add Clock icon
- Increase font size to match date display
- Use monospace font for better readability
- Color-coded by status (emerald/amber/red)

ExpirationInfo remains the single source of expiration data.

* fix: correct cache hit rate formula to exclude output tokens

Output tokens are never cached (per Anthropic docs), so they should not be
included in cache hit rate calculation. Changed formula from:
  cacheReadTokens / (input + output + cacheCreate + cacheRead)
to:
  cacheReadTokens / (input + cacheCreate + cacheRead)

Affects:
- /my-usage model breakdown cache hit rate display
- /dashboard/leaderboard provider cache hit rate ranking

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: address PR #623 review feedback

- Fix outdated cache hit rate comment (leaderboard.ts:430)
- Add keyboard accessibility to model breakdown rows (a11y)
- Rename totalTokens -> totalInputTokens in ProviderCacheHitRateLeaderboardEntry
- Extract parseDateRangeInServerTimezone helper to reduce duplication

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: add backward compatibility for totalTokens field

Keep returning totalTokens (deprecated) alongside totalInputTokens
for API consumers that haven't migrated yet.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: John Doe <johndoe@example.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Set HOSTNAME environment variable in Dockerfile (#622)

Add HOSTNAME environment variable for container

* fix: inherit 1M flag from client

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* fix(my-usage): make date range DST-safe

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* test(api): cover leaderboard comma-list parsing

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix(auth): avoid hardcoded server error fallback

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix(actions): localize key quota permission errors

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* docs: clarify context 1M inherit behavior

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* test(settings): fix model multi-select messages loader

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* test(dashboard): provide QueryClientProvider in edit key form test

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* chore(scripts): avoid hardcoded docker container names

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix(i18n): replace fullwidth parentheses in ja dashboard

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* fix(ui): add a11y label and clean up dialog styles

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* chore: ignore tmp scratch directory

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

* feat: Dashboard Logs:秒级时间筛选 + Session ID 精确筛选/联想/展示(含回归修复) (#611)

* feat: add sessionId filter for usage logs

* feat: add seconds-level time filters for logs

* feat: wire sessionId into logs URL filters

* chore: add i18n keys for logs sessionId

* feat: add sessionId column to logs tables

* feat: add sessionId suggestions for logs

* docs: document dashboard logs call chain

* test: add logs sessionId/time filter coverage config

* fix: keep sessionId search input focused

* fix: drop leaked page param on logs apply

* fix: reload sessionId suggestions on scope change

* fix: harden logs url params and time parsing

* fix: avoid keys join for sessionId suggestions

* test: strengthen empty sessionId filter assertions

* chore: format logs sessionId suggestions test

* Update src/actions/usage-logs.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* feat: 补充公共静态变量 SESSION_ID_SUGGESTION_LIMIT

* fix: use prefix LIKE for sessionId suggestions

* refactor: centralize usage logs sessionId suggestion constants

* refactor: simplify logs url filters parsing

* refactor: reuse clipboard util for sessionId copy

* chore(db): add sessionId prefix index

* docs: clarify sessionId suggestion semantics

* test: add escapeLike unit tests

* chore: apply biome fixes for sessionId search

* feat: include session id in error responses

* test: add coverage suite for session id errors

* docs: add guide for error session id

* chore: format code (feat-logs-sessionid-time-filter-233f96a)

* feat(dashboard/logs): add fullscreen mode (#632)

* Fix provider exhaustion after model redirect (refs #629) (#633)

* Fix provider fallback after model redirect

Use original model for provider selection during failover and tolerate tool_result blocks in non-stream converters to prevent premature provider exhaustion. References #629.

* Add regression test for model redirect provider selection

Ensures provider selection uses original model even when current model is redirected (refs #629).

* chore: format code (fix-629-provider-fallback-toolresult-b17f671)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: YangQing-Lin <56943790+YangQing-Lin@users.noreply.github.com>
Co-authored-by: SaladDay <92240037+SaladDay@users.noreply.github.com>
Co-authored-by: miraserver <20286838+miraserver@users.noreply.github.com>
Co-authored-by: John Doe <johndoe@example.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: hwa <yll2002mail@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Ding <ding113@users.noreply.github.com>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@ding113 ding113 deleted the feat/dashboard-logs-fullscreen branch January 27, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n area:UI enhancement New feature or request size/L Large PR (< 1000 lines)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant