mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
fix(panel): disable click-to-jump on project ranking rows
This commit is contained in:
@@ -1546,7 +1546,6 @@ const I18N_MESSAGES_ZH_CN = Object.freeze({
|
|||||||
'cons.rankTabWorkspacesCount': '项目排行 ({count})',
|
'cons.rankTabWorkspacesCount': '项目排行 ({count})',
|
||||||
'cons.workspaceUnbound': '未绑定工作区',
|
'cons.workspaceUnbound': '未绑定工作区',
|
||||||
'cons.workspaceSessions': '{count} 会话',
|
'cons.workspaceSessions': '{count} 会话',
|
||||||
'cons.workspaceJumpTip': '点击跳转到该项目最近会话',
|
|
||||||
'cons.exportMenuAria': '导出及报告选项',
|
'cons.exportMenuAria': '导出及报告选项',
|
||||||
'cons.exportXlsx': '导出 Excel (.xlsx)',
|
'cons.exportXlsx': '导出 Excel (.xlsx)',
|
||||||
'cons.exportXlsxTip': '导出多工作表排版精美的 Excel 报表(自动列宽、千分位及对齐)',
|
'cons.exportXlsxTip': '导出多工作表排版精美的 Excel 报表(自动列宽、千分位及对齐)',
|
||||||
@@ -2440,7 +2439,6 @@ const I18N_MESSAGES_EN_US = Object.freeze({
|
|||||||
'cons.rankTabWorkspacesCount': 'Projects ({count})',
|
'cons.rankTabWorkspacesCount': 'Projects ({count})',
|
||||||
'cons.workspaceUnbound': 'Unbound Workspace',
|
'cons.workspaceUnbound': 'Unbound Workspace',
|
||||||
'cons.workspaceSessions': '{count} sessions',
|
'cons.workspaceSessions': '{count} sessions',
|
||||||
'cons.workspaceJumpTip': 'Click to inspect latest session in this project',
|
|
||||||
'cons.exportMenuAria': 'Export and report actions',
|
'cons.exportMenuAria': 'Export and report actions',
|
||||||
'cons.exportXlsx': 'Export Excel (.xlsx)',
|
'cons.exportXlsx': 'Export Excel (.xlsx)',
|
||||||
'cons.exportXlsxTip': 'Export styled multi-sheet Excel workbook with auto column width and alignment',
|
'cons.exportXlsxTip': 'Export styled multi-sheet Excel workbook with auto column width and alignment',
|
||||||
@@ -30855,7 +30853,7 @@ const ConsumptionView = defineComponent({
|
|||||||
{
|
{
|
||||||
className: 'cons-top-conv-row',
|
className: 'cons-top-conv-row',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
if (!rowState.cascadeId) return;
|
if (!rowState.canJump || !rowState.cascadeId) return;
|
||||||
hideBreakdownPopover();
|
hideBreakdownPopover();
|
||||||
selectConversation(rowState.cascadeId);
|
selectConversation(rowState.cascadeId);
|
||||||
uiStore.setState({
|
uiStore.setState({
|
||||||
@@ -30911,10 +30909,9 @@ const ConsumptionView = defineComponent({
|
|||||||
? t('cons.workspaceUnbound')
|
? t('cons.workspaceUnbound')
|
||||||
: String(item.label || item.workspacePath || '—').trim()
|
: String(item.label || item.workspacePath || '—').trim()
|
||||||
: String(item.title || item.cascadeId || '—').trim();
|
: String(item.title || item.cascadeId || '—').trim();
|
||||||
refs.rowState.cascadeId = String(
|
refs.rowState.cascadeId = isWorkspaceRow ? '' : String(item.cascadeId || '');
|
||||||
isWorkspaceRow ? item.latestCascadeId || '' : item.cascadeId || ''
|
refs.rowState.canJump =
|
||||||
);
|
!isWorkspaceRow && item.canJump !== false && Boolean(refs.rowState.cascadeId);
|
||||||
refs.rowState.canJump = item.canJump !== false && Boolean(refs.rowState.cascadeId);
|
|
||||||
patchClasses(refs.rowEl, {
|
patchClasses(refs.rowEl, {
|
||||||
'is-jumpable': refs.rowState.canJump,
|
'is-jumpable': refs.rowState.canJump,
|
||||||
'cons-workspace-row': isWorkspaceRow,
|
'cons-workspace-row': isWorkspaceRow,
|
||||||
@@ -30923,8 +30920,11 @@ const ConsumptionView = defineComponent({
|
|||||||
isWorkspaceRow && item.workspacePath && item.workspacePath !== title
|
isWorkspaceRow && item.workspacePath && item.workspacePath !== title
|
||||||
? `${title} (${item.workspacePath})`
|
? `${title} (${item.workspacePath})`
|
||||||
: title;
|
: title;
|
||||||
const jumpTip = isWorkspaceRow ? t('cons.workspaceJumpTip') : t('cons.topConvJumpTip');
|
patchAttr(
|
||||||
patchAttr(refs.rowEl, 'title', refs.rowState.canJump ? `${baseTip} — ${jumpTip}` : baseTip);
|
refs.rowEl,
|
||||||
|
'title',
|
||||||
|
refs.rowState.canJump ? `${baseTip} — ${t('cons.topConvJumpTip')}` : baseTip
|
||||||
|
);
|
||||||
patchText(refs.titleTextEl, title);
|
patchText(refs.titleTextEl, title);
|
||||||
if (refs.wsBadgeEl) {
|
if (refs.wsBadgeEl) {
|
||||||
const showWsBadge = isWorkspaceRow && Number(item.sessionCount || 0) > 0;
|
const showWsBadge = isWorkspaceRow && Number(item.sessionCount || 0) > 0;
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>用量监控</title>
|
<title>用量监控</title>
|
||||||
<link rel="stylesheet" href="/styles.css?v=1795456766440">
|
<link rel="stylesheet" href="/styles.css?v=1795457102792">
|
||||||
<script src="/preload.js"></script>
|
<script src="/preload.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app-root"></div>
|
<div id="app-root"></div>
|
||||||
<script src="/app.js?v=1795456766440"></script>
|
<script src="/app.js?v=1795457102792"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -287,7 +287,6 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
|
|||||||
'cons.rankTabWorkspacesCount': 'Projects ({count})',
|
'cons.rankTabWorkspacesCount': 'Projects ({count})',
|
||||||
'cons.workspaceUnbound': 'Unbound Workspace',
|
'cons.workspaceUnbound': 'Unbound Workspace',
|
||||||
'cons.workspaceSessions': '{count} sessions',
|
'cons.workspaceSessions': '{count} sessions',
|
||||||
'cons.workspaceJumpTip': 'Click to inspect latest session in this project',
|
|
||||||
'cons.exportMenuAria': 'Export and report actions',
|
'cons.exportMenuAria': 'Export and report actions',
|
||||||
'cons.exportXlsx': 'Export Excel (.xlsx)',
|
'cons.exportXlsx': 'Export Excel (.xlsx)',
|
||||||
'cons.exportXlsxTip': 'Export styled multi-sheet Excel workbook with auto column width and alignment',
|
'cons.exportXlsxTip': 'Export styled multi-sheet Excel workbook with auto column width and alignment',
|
||||||
|
|||||||
@@ -287,7 +287,6 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
|
|||||||
'cons.rankTabWorkspacesCount': '项目排行 ({count})',
|
'cons.rankTabWorkspacesCount': '项目排行 ({count})',
|
||||||
'cons.workspaceUnbound': '未绑定工作区',
|
'cons.workspaceUnbound': '未绑定工作区',
|
||||||
'cons.workspaceSessions': '{count} 会话',
|
'cons.workspaceSessions': '{count} 会话',
|
||||||
'cons.workspaceJumpTip': '点击跳转到该项目最近会话',
|
|
||||||
'cons.exportMenuAria': '导出及报告选项',
|
'cons.exportMenuAria': '导出及报告选项',
|
||||||
'cons.exportXlsx': '导出 Excel (.xlsx)',
|
'cons.exportXlsx': '导出 Excel (.xlsx)',
|
||||||
'cons.exportXlsxTip': '导出多工作表排版精美的 Excel 报表(自动列宽、千分位及对齐)',
|
'cons.exportXlsxTip': '导出多工作表排版精美的 Excel 报表(自动列宽、千分位及对齐)',
|
||||||
|
|||||||
@@ -1520,7 +1520,7 @@ export const ConsumptionView = defineComponent({
|
|||||||
{
|
{
|
||||||
className: 'cons-top-conv-row',
|
className: 'cons-top-conv-row',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
if (!rowState.cascadeId) return;
|
if (!rowState.canJump || !rowState.cascadeId) return;
|
||||||
hideBreakdownPopover();
|
hideBreakdownPopover();
|
||||||
selectConversation(rowState.cascadeId);
|
selectConversation(rowState.cascadeId);
|
||||||
uiStore.setState({
|
uiStore.setState({
|
||||||
@@ -1576,10 +1576,9 @@ export const ConsumptionView = defineComponent({
|
|||||||
? t('cons.workspaceUnbound')
|
? t('cons.workspaceUnbound')
|
||||||
: String(item.label || item.workspacePath || '—').trim()
|
: String(item.label || item.workspacePath || '—').trim()
|
||||||
: String(item.title || item.cascadeId || '—').trim();
|
: String(item.title || item.cascadeId || '—').trim();
|
||||||
refs.rowState.cascadeId = String(
|
refs.rowState.cascadeId = isWorkspaceRow ? '' : String(item.cascadeId || '');
|
||||||
isWorkspaceRow ? item.latestCascadeId || '' : item.cascadeId || ''
|
refs.rowState.canJump =
|
||||||
);
|
!isWorkspaceRow && item.canJump !== false && Boolean(refs.rowState.cascadeId);
|
||||||
refs.rowState.canJump = item.canJump !== false && Boolean(refs.rowState.cascadeId);
|
|
||||||
patchClasses(refs.rowEl, {
|
patchClasses(refs.rowEl, {
|
||||||
'is-jumpable': refs.rowState.canJump,
|
'is-jumpable': refs.rowState.canJump,
|
||||||
'cons-workspace-row': isWorkspaceRow,
|
'cons-workspace-row': isWorkspaceRow,
|
||||||
@@ -1588,8 +1587,11 @@ export const ConsumptionView = defineComponent({
|
|||||||
isWorkspaceRow && item.workspacePath && item.workspacePath !== title
|
isWorkspaceRow && item.workspacePath && item.workspacePath !== title
|
||||||
? `${title} (${item.workspacePath})`
|
? `${title} (${item.workspacePath})`
|
||||||
: title;
|
: title;
|
||||||
const jumpTip = isWorkspaceRow ? t('cons.workspaceJumpTip') : t('cons.topConvJumpTip');
|
patchAttr(
|
||||||
patchAttr(refs.rowEl, 'title', refs.rowState.canJump ? `${baseTip} — ${jumpTip}` : baseTip);
|
refs.rowEl,
|
||||||
|
'title',
|
||||||
|
refs.rowState.canJump ? `${baseTip} — ${t('cons.topConvJumpTip')}` : baseTip
|
||||||
|
);
|
||||||
patchText(refs.titleTextEl, title);
|
patchText(refs.titleTextEl, title);
|
||||||
if (refs.wsBadgeEl) {
|
if (refs.wsBadgeEl) {
|
||||||
const showWsBadge = isWorkspaceRow && Number(item.sessionCount || 0) > 0;
|
const showWsBadge = isWorkspaceRow && Number(item.sessionCount || 0) > 0;
|
||||||
|
|||||||
@@ -1215,10 +1215,13 @@ test('Feature 9: workspace/project cost aggregation (full + fast paths) and Proj
|
|||||||
const wsRowsAfterSort = view.el.querySelectorAll('.cons-workspace-row');
|
const wsRowsAfterSort = view.el.querySelectorAll('.cons-workspace-row');
|
||||||
assert.equal(wsRowsAfterSort[0].querySelector('.cons-row-title-text').textContent, 'docs-site');
|
assert.equal(wsRowsAfterSort[0].querySelector('.cons-row-title-text').textContent, 'docs-site');
|
||||||
|
|
||||||
// Click workspace row jumps to its latest conversation in steps view
|
// Project rows are read-only breakdown cards and must not jump on click
|
||||||
|
assert.equal(wsRowsAfterSort[0].classList.contains('is-jumpable'), false);
|
||||||
|
const prevView = uiStore.getState().activeView;
|
||||||
|
const prevSelectedCid = telemetryStore.getState().selectedConversationId;
|
||||||
wsRowsAfterSort[0].dispatchEvent({ type: 'click' });
|
wsRowsAfterSort[0].dispatchEvent({ type: 'click' });
|
||||||
assert.equal(uiStore.getState().activeView, 'steps');
|
assert.equal(uiStore.getState().activeView, prevView);
|
||||||
assert.equal(telemetryStore.getState().selectedConversationId, 'ws-conv-b1');
|
assert.equal(telemetryStore.getState().selectedConversationId, prevSelectedCid);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Feature 10: StepsDetailView live search, dynamic diagnostic chips, and click-to-inspect step drawer', async (t) => {
|
test('Feature 10: StepsDetailView live search, dynamic diagnostic chips, and click-to-inspect step drawer', async (t) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user