Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion app/components/MyUsageViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,23 @@
<v-col cols="12" sm="6" md="3">
<v-card variant="tonal" color="deep-purple" class="h-100">
<v-card-text>
<div class="text-caption">Accepted lines</div>
<div class="text-caption d-flex align-center">
Accepted lines
<v-tooltip location="top" max-width="280">
<template #activator="{ props: tipProps }">
<v-icon
v-bind="tipProps"
data-testid="my-usage-accepted-lines-tooltip"
size="14"
class="ml-1"
color="deep-purple"
>
mdi-information-outline
</v-icon>
</template>
<span>Lines added from accepted completions and agent edits. Chat / ask-only usage adds no lines, so this can be 0 even with many interactions.</span>
</v-tooltip>
</div>
<div class="text-h4 font-weight-bold">
{{ data.totals.loc_added_sum.toLocaleString() }}
</div>
Expand Down
16 changes: 16 additions & 0 deletions tests/MyUsageViewer.source.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// @vitest-environment node

import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'node:path';
import { describe, expect, it } from 'vitest';

const __dirname = dirname(fileURLToPath(import.meta.url));
const componentSource = readFileSync(resolve(__dirname, '../app/components/MyUsageViewer.vue'), 'utf8');

describe('MyUsageViewer source', () => {
it('documents why accepted lines can be zero for chat-only usage', () => {
expect(componentSource).toContain('data-testid="my-usage-accepted-lines-tooltip"');
expect(componentSource).toContain('Lines added from accepted completions and agent edits. Chat / ask-only usage adds no lines, so this can be 0 even with many interactions.');
});
});
Loading