markupr 2.1.8 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +292 -15
- package/dist/cli/index.mjs +3593 -0
- package/dist/main/index.mjs +743 -220
- package/dist/mcp/index.mjs +4053 -0
- package/package.json +32 -7
- package/.claude/commands/review-feedback.md +0 -47
- package/.eslintrc.json +0 -35
- package/.github/CODEOWNERS +0 -16
- package/.github/FUNDING.yml +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -56
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -54
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -89
- package/.github/dependabot.yml +0 -70
- package/.github/workflows/ci.yml +0 -184
- package/.github/workflows/deploy-landing.yml +0 -134
- package/.github/workflows/nightly.yml +0 -288
- package/.github/workflows/release.yml +0 -318
- package/CHANGELOG.md +0 -127
- package/CLAUDE.md +0 -137
- package/CODE_OF_CONDUCT.md +0 -9
- package/CONTRIBUTING.md +0 -390
- package/PRODUCT_VISION.md +0 -277
- package/SECURITY.md +0 -51
- package/SIGNING_INSTRUCTIONS.md +0 -284
- package/assets/DMG_BACKGROUND_INSTRUCTIONS.md +0 -130
- package/assets/svg-source/dmg-background.svg +0 -70
- package/assets/svg-source/icon.svg +0 -20
- package/assets/svg-source/tray-icon-processing.svg +0 -7
- package/assets/svg-source/tray-icon-recording.svg +0 -7
- package/assets/svg-source/tray-icon.svg +0 -6
- package/assets/tray-complete.png +0 -0
- package/assets/tray-complete@2x.png +0 -0
- package/assets/tray-completeTemplate.png +0 -0
- package/assets/tray-completeTemplate@2x.png +0 -0
- package/assets/tray-error.png +0 -0
- package/assets/tray-error@2x.png +0 -0
- package/assets/tray-errorTemplate.png +0 -0
- package/assets/tray-errorTemplate@2x.png +0 -0
- package/assets/tray-icon-processing.png +0 -0
- package/assets/tray-icon-processing@2x.png +0 -0
- package/assets/tray-icon-processingTemplate.png +0 -0
- package/assets/tray-icon-processingTemplate@2x.png +0 -0
- package/assets/tray-icon-recording.png +0 -0
- package/assets/tray-icon-recording@2x.png +0 -0
- package/assets/tray-icon-recordingTemplate.png +0 -0
- package/assets/tray-icon-recordingTemplate@2x.png +0 -0
- package/assets/tray-icon.png +0 -0
- package/assets/tray-icon@2x.png +0 -0
- package/assets/tray-iconTemplate.png +0 -0
- package/assets/tray-iconTemplate@2x.png +0 -0
- package/assets/tray-idle.png +0 -0
- package/assets/tray-idle@2x.png +0 -0
- package/assets/tray-idleTemplate.png +0 -0
- package/assets/tray-idleTemplate@2x.png +0 -0
- package/assets/tray-processing-0.png +0 -0
- package/assets/tray-processing-0@2x.png +0 -0
- package/assets/tray-processing-0Template.png +0 -0
- package/assets/tray-processing-0Template@2x.png +0 -0
- package/assets/tray-processing-1.png +0 -0
- package/assets/tray-processing-1@2x.png +0 -0
- package/assets/tray-processing-1Template.png +0 -0
- package/assets/tray-processing-1Template@2x.png +0 -0
- package/assets/tray-processing-2.png +0 -0
- package/assets/tray-processing-2@2x.png +0 -0
- package/assets/tray-processing-2Template.png +0 -0
- package/assets/tray-processing-2Template@2x.png +0 -0
- package/assets/tray-processing-3.png +0 -0
- package/assets/tray-processing-3@2x.png +0 -0
- package/assets/tray-processing-3Template.png +0 -0
- package/assets/tray-processing-3Template@2x.png +0 -0
- package/assets/tray-processing.png +0 -0
- package/assets/tray-processing@2x.png +0 -0
- package/assets/tray-processingTemplate.png +0 -0
- package/assets/tray-processingTemplate@2x.png +0 -0
- package/assets/tray-recording.png +0 -0
- package/assets/tray-recording@2x.png +0 -0
- package/assets/tray-recordingTemplate.png +0 -0
- package/assets/tray-recordingTemplate@2x.png +0 -0
- package/build/DMG_BACKGROUND_SPEC.md +0 -50
- package/build/dmg-background.png +0 -0
- package/build/dmg-background@2x.png +0 -0
- package/build/entitlements.mac.inherit.plist +0 -27
- package/build/entitlements.mac.plist +0 -41
- package/build/favicon-16.png +0 -0
- package/build/favicon-180.png +0 -0
- package/build/favicon-192.png +0 -0
- package/build/favicon-32.png +0 -0
- package/build/favicon-48.png +0 -0
- package/build/favicon-512.png +0 -0
- package/build/favicon-64.png +0 -0
- package/build/icon-128.png +0 -0
- package/build/icon-16.png +0 -0
- package/build/icon-24.png +0 -0
- package/build/icon-256.png +0 -0
- package/build/icon-32.png +0 -0
- package/build/icon-48.png +0 -0
- package/build/icon-64.png +0 -0
- package/build/icon.icns +0 -0
- package/build/icon.ico +0 -0
- package/build/icon.iconset/icon_128x128.png +0 -0
- package/build/icon.iconset/icon_128x128@2x.png +0 -0
- package/build/icon.iconset/icon_16x16.png +0 -0
- package/build/icon.iconset/icon_16x16@2x.png +0 -0
- package/build/icon.iconset/icon_256x256.png +0 -0
- package/build/icon.iconset/icon_256x256@2x.png +0 -0
- package/build/icon.iconset/icon_32x32.png +0 -0
- package/build/icon.iconset/icon_32x32@2x.png +0 -0
- package/build/icon.iconset/icon_512x512.png +0 -0
- package/build/icon.iconset/icon_512x512@2x.png +0 -0
- package/build/icon.png +0 -0
- package/build/installer-header.bmp +0 -0
- package/build/installer-header.png +0 -0
- package/build/installer-sidebar.bmp +0 -0
- package/build/installer-sidebar.png +0 -0
- package/build/installer.nsh +0 -45
- package/build/overlay-processing.png +0 -0
- package/build/overlay-recording.png +0 -0
- package/build/toolbar-record.png +0 -0
- package/build/toolbar-screenshot.png +0 -0
- package/build/toolbar-settings.png +0 -0
- package/build/toolbar-stop.png +0 -0
- package/dist/preload/index.mjs +0 -907
- package/dist/renderer/assets/index-CCmUjl9K.js +0 -19495
- package/dist/renderer/assets/index-CUqz_Gs6.css +0 -2270
- package/dist/renderer/index.html +0 -27
- package/docs/AI_AGENT_QUICKSTART.md +0 -42
- package/docs/AI_PIPELINE_DESIGN.md +0 -595
- package/docs/API.md +0 -514
- package/docs/ARCHITECTURE.md +0 -460
- package/docs/CONFIGURATION.md +0 -336
- package/docs/DEVELOPMENT.md +0 -508
- package/docs/EXPORT_FORMATS.md +0 -451
- package/docs/GETTING_STARTED.md +0 -236
- package/docs/KEYBOARD_SHORTCUTS.md +0 -334
- package/docs/TROUBLESHOOTING.md +0 -418
- package/docs/landing/index.html +0 -672
- package/docs/landing/script.js +0 -342
- package/docs/landing/styles.css +0 -1543
- package/electron-builder.yml +0 -140
- package/electron.vite.config.ts +0 -63
- package/railway.json +0 -12
- package/scripts/build.mjs +0 -51
- package/scripts/generate-icons.mjs +0 -314
- package/scripts/generate-installer-images.cjs +0 -253
- package/scripts/generate-tray-icons.mjs +0 -258
- package/scripts/notarize.cjs +0 -180
- package/scripts/one-click-clean-test.sh +0 -147
- package/scripts/postinstall.mjs +0 -36
- package/scripts/setup-markupr.sh +0 -55
- package/setup +0 -17
- package/site/index.html +0 -1835
- package/site/package.json +0 -11
- package/site/railway.json +0 -12
- package/site/server.js +0 -31
- package/src/main/AutoUpdater.ts +0 -392
- package/src/main/CrashRecovery.ts +0 -655
- package/src/main/ErrorHandler.ts +0 -703
- package/src/main/HotkeyManager.ts +0 -399
- package/src/main/MenuManager.ts +0 -529
- package/src/main/PermissionManager.ts +0 -420
- package/src/main/SessionController.ts +0 -1465
- package/src/main/TrayManager.ts +0 -540
- package/src/main/ai/AIPipelineManager.ts +0 -199
- package/src/main/ai/ClaudeAnalyzer.ts +0 -339
- package/src/main/ai/ImageOptimizer.ts +0 -176
- package/src/main/ai/StructuredMarkdownBuilder.ts +0 -379
- package/src/main/ai/index.ts +0 -16
- package/src/main/ai/types.ts +0 -258
- package/src/main/analysis/ClarificationGenerator.ts +0 -385
- package/src/main/analysis/FeedbackAnalyzer.ts +0 -531
- package/src/main/analysis/index.ts +0 -19
- package/src/main/audio/AudioCapture.ts +0 -978
- package/src/main/audio/audioUtils.ts +0 -100
- package/src/main/audio/index.ts +0 -20
- package/src/main/capture/index.ts +0 -1
- package/src/main/index.ts +0 -1693
- package/src/main/ipc/captureHandlers.ts +0 -272
- package/src/main/ipc/index.ts +0 -45
- package/src/main/ipc/outputHandlers.ts +0 -302
- package/src/main/ipc/sessionHandlers.ts +0 -56
- package/src/main/ipc/settingsHandlers.ts +0 -471
- package/src/main/ipc/types.ts +0 -56
- package/src/main/ipc/windowHandlers.ts +0 -277
- package/src/main/output/ClipboardService.ts +0 -369
- package/src/main/output/ExportService.ts +0 -539
- package/src/main/output/FileManager.ts +0 -416
- package/src/main/output/MarkdownGenerator.ts +0 -791
- package/src/main/output/MarkdownPatcher.ts +0 -299
- package/src/main/output/index.ts +0 -186
- package/src/main/output/sessionAdapter.ts +0 -207
- package/src/main/output/templates/html-template.ts +0 -553
- package/src/main/pipeline/FrameExtractor.ts +0 -330
- package/src/main/pipeline/PostProcessor.ts +0 -399
- package/src/main/pipeline/TranscriptAnalyzer.ts +0 -226
- package/src/main/pipeline/index.ts +0 -36
- package/src/main/platform/WindowsTaskbar.ts +0 -600
- package/src/main/platform/index.ts +0 -16
- package/src/main/settings/SettingsManager.ts +0 -730
- package/src/main/settings/index.ts +0 -19
- package/src/main/transcription/ModelDownloadManager.ts +0 -494
- package/src/main/transcription/TierManager.ts +0 -219
- package/src/main/transcription/TranscriptionRecoveryService.ts +0 -340
- package/src/main/transcription/WhisperService.ts +0 -748
- package/src/main/transcription/index.ts +0 -56
- package/src/main/transcription/types.ts +0 -135
- package/src/main/windows/PopoverManager.ts +0 -284
- package/src/main/windows/TaskbarIntegration.ts +0 -452
- package/src/main/windows/index.ts +0 -23
- package/src/preload/index.ts +0 -1047
- package/src/renderer/App.tsx +0 -515
- package/src/renderer/AppWrapper.tsx +0 -28
- package/src/renderer/assets/logo-dark.svg +0 -7
- package/src/renderer/assets/logo.svg +0 -7
- package/src/renderer/audio/AudioCaptureRenderer.ts +0 -454
- package/src/renderer/capture/ScreenRecordingRenderer.ts +0 -492
- package/src/renderer/components/AnnotationOverlay.tsx +0 -836
- package/src/renderer/components/AudioWaveform.tsx +0 -811
- package/src/renderer/components/ClarificationQuestions.tsx +0 -656
- package/src/renderer/components/CountdownTimer.tsx +0 -495
- package/src/renderer/components/CrashRecoveryDialog.tsx +0 -632
- package/src/renderer/components/DonateButton.tsx +0 -127
- package/src/renderer/components/ErrorBoundary.tsx +0 -308
- package/src/renderer/components/ExportDialog.tsx +0 -872
- package/src/renderer/components/HotkeyHint.tsx +0 -261
- package/src/renderer/components/KeyboardShortcuts.tsx +0 -787
- package/src/renderer/components/ModelDownloadDialog.tsx +0 -844
- package/src/renderer/components/Onboarding.tsx +0 -1830
- package/src/renderer/components/ProcessingOverlay.tsx +0 -157
- package/src/renderer/components/RecordingOverlay.tsx +0 -423
- package/src/renderer/components/SessionHistory.tsx +0 -1746
- package/src/renderer/components/SessionReview.tsx +0 -1321
- package/src/renderer/components/SettingsPanel.tsx +0 -217
- package/src/renderer/components/Skeleton.tsx +0 -347
- package/src/renderer/components/StatusIndicator.tsx +0 -86
- package/src/renderer/components/ThemeProvider.tsx +0 -429
- package/src/renderer/components/Tooltip.tsx +0 -370
- package/src/renderer/components/TranscriptionPreview.tsx +0 -183
- package/src/renderer/components/TranscriptionTierSelector.tsx +0 -640
- package/src/renderer/components/UpdateNotification.tsx +0 -377
- package/src/renderer/components/WindowSelector.tsx +0 -947
- package/src/renderer/components/index.ts +0 -99
- package/src/renderer/components/primitives/ApiKeyInput.tsx +0 -98
- package/src/renderer/components/primitives/ColorPicker.tsx +0 -65
- package/src/renderer/components/primitives/DangerButton.tsx +0 -45
- package/src/renderer/components/primitives/DirectoryPicker.tsx +0 -41
- package/src/renderer/components/primitives/Dropdown.tsx +0 -34
- package/src/renderer/components/primitives/KeyRecorder.tsx +0 -117
- package/src/renderer/components/primitives/SettingsSection.tsx +0 -32
- package/src/renderer/components/primitives/Slider.tsx +0 -43
- package/src/renderer/components/primitives/Toggle.tsx +0 -36
- package/src/renderer/components/primitives/index.ts +0 -10
- package/src/renderer/components/settings/AdvancedTab.tsx +0 -174
- package/src/renderer/components/settings/AppearanceTab.tsx +0 -77
- package/src/renderer/components/settings/GeneralTab.tsx +0 -40
- package/src/renderer/components/settings/HotkeysTab.tsx +0 -79
- package/src/renderer/components/settings/RecordingTab.tsx +0 -84
- package/src/renderer/components/settings/index.ts +0 -9
- package/src/renderer/components/settings/settingsStyles.ts +0 -673
- package/src/renderer/components/settings/tabConfig.tsx +0 -85
- package/src/renderer/components/settings/useSettingsPanel.ts +0 -447
- package/src/renderer/contexts/ProcessingContext.tsx +0 -227
- package/src/renderer/contexts/RecordingContext.tsx +0 -683
- package/src/renderer/contexts/UIContext.tsx +0 -326
- package/src/renderer/contexts/index.ts +0 -24
- package/src/renderer/donateMessages.ts +0 -69
- package/src/renderer/hooks/index.ts +0 -75
- package/src/renderer/hooks/useAnimation.tsx +0 -544
- package/src/renderer/hooks/useTheme.ts +0 -313
- package/src/renderer/index.html +0 -26
- package/src/renderer/main.tsx +0 -52
- package/src/renderer/styles/animations.css +0 -1093
- package/src/renderer/styles/app-shell.css +0 -662
- package/src/renderer/styles/globals.css +0 -515
- package/src/renderer/styles/theme.ts +0 -578
- package/src/renderer/types/electron.d.ts +0 -385
- package/src/shared/hotkeys.ts +0 -283
- package/src/shared/types.ts +0 -809
- package/tests/clipboard.test.ts +0 -228
- package/tests/e2e/criticalPaths.test.ts +0 -594
- package/tests/feedbackAnalyzer.test.ts +0 -303
- package/tests/integration/sessionFlow.test.ts +0 -583
- package/tests/markdownGenerator.test.ts +0 -418
- package/tests/output.test.ts +0 -96
- package/tests/setup.ts +0 -486
- package/tests/unit/appIntegration.test.ts +0 -676
- package/tests/unit/appViewState.test.ts +0 -281
- package/tests/unit/audioIpcChannels.test.ts +0 -17
- package/tests/unit/exportService.test.ts +0 -492
- package/tests/unit/hotkeys.test.ts +0 -92
- package/tests/unit/navigationPreload.test.ts +0 -94
- package/tests/unit/onboardingFlow.test.ts +0 -345
- package/tests/unit/permissionManager.test.ts +0 -175
- package/tests/unit/permissionManagerExpanded.test.ts +0 -296
- package/tests/unit/screenRecordingRenderer.test.ts +0 -368
- package/tests/unit/sessionController.test.ts +0 -515
- package/tests/unit/tierManager.test.ts +0 -61
- package/tests/unit/tierManagerExpanded.test.ts +0 -142
- package/tests/unit/transcriptAnalyzer.test.ts +0 -64
- package/tsconfig.json +0 -25
- package/vitest.config.ts +0 -46
|
@@ -1,418 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MarkdownGenerator Tests
|
|
3
|
-
*
|
|
4
|
-
* Tests for the llms.txt-inspired markdown output generator.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { describe, it, expect, beforeEach } from 'vitest';
|
|
8
|
-
import {
|
|
9
|
-
MarkdownGenerator,
|
|
10
|
-
markdownGenerator,
|
|
11
|
-
adaptFeedbackSession,
|
|
12
|
-
type Session,
|
|
13
|
-
type FeedbackItem,
|
|
14
|
-
type GenerateOptions,
|
|
15
|
-
} from '../src/main/output/MarkdownGenerator';
|
|
16
|
-
import type { FeedbackSession, Screenshot, TranscriptionSegment } from '../src/shared/types';
|
|
17
|
-
|
|
18
|
-
describe('MarkdownGenerator', () => {
|
|
19
|
-
let generator: MarkdownGenerator;
|
|
20
|
-
|
|
21
|
-
beforeEach(() => {
|
|
22
|
-
generator = new MarkdownGenerator();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
describe('generateFeedbackItemId', () => {
|
|
26
|
-
it('should generate FB-001 format IDs', () => {
|
|
27
|
-
expect(generator.generateFeedbackItemId(0)).toBe('FB-001');
|
|
28
|
-
expect(generator.generateFeedbackItemId(1)).toBe('FB-002');
|
|
29
|
-
expect(generator.generateFeedbackItemId(9)).toBe('FB-010');
|
|
30
|
-
expect(generator.generateFeedbackItemId(99)).toBe('FB-100');
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
describe('generateFullDocument', () => {
|
|
35
|
-
const mockSession: Session = {
|
|
36
|
-
id: 'test-session-123',
|
|
37
|
-
startTime: new Date('2024-01-15T10:00:00').getTime(),
|
|
38
|
-
endTime: new Date('2024-01-15T10:05:30').getTime(),
|
|
39
|
-
feedbackItems: [
|
|
40
|
-
{
|
|
41
|
-
id: 'item-1',
|
|
42
|
-
transcription: 'The button is broken and does not submit the form.',
|
|
43
|
-
timestamp: new Date('2024-01-15T10:00:30').getTime(),
|
|
44
|
-
screenshots: [
|
|
45
|
-
{
|
|
46
|
-
id: 'ss-1',
|
|
47
|
-
timestamp: new Date('2024-01-15T10:00:35').getTime(),
|
|
48
|
-
imagePath: '/tmp/ss-1.png',
|
|
49
|
-
width: 1920,
|
|
50
|
-
height: 1080,
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
category: 'Bug',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: 'item-2',
|
|
57
|
-
transcription: 'This form is confusing. The labels are unclear.',
|
|
58
|
-
timestamp: new Date('2024-01-15T10:02:00').getTime(),
|
|
59
|
-
screenshots: [],
|
|
60
|
-
category: 'UX Issue',
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: 'item-3',
|
|
64
|
-
transcription: 'It would be nice if there was a dark mode option.',
|
|
65
|
-
timestamp: new Date('2024-01-15T10:04:00').getTime(),
|
|
66
|
-
screenshots: [
|
|
67
|
-
{
|
|
68
|
-
id: 'ss-2',
|
|
69
|
-
timestamp: new Date('2024-01-15T10:04:05').getTime(),
|
|
70
|
-
imagePath: '/tmp/ss-2.png',
|
|
71
|
-
width: 1920,
|
|
72
|
-
height: 1080,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
id: 'ss-3',
|
|
76
|
-
timestamp: new Date('2024-01-15T10:04:10').getTime(),
|
|
77
|
-
imagePath: '/tmp/ss-3.png',
|
|
78
|
-
width: 1920,
|
|
79
|
-
height: 1080,
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
category: 'Suggestion',
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
metadata: {
|
|
86
|
-
os: 'darwin',
|
|
87
|
-
sourceName: 'TestApp',
|
|
88
|
-
sourceType: 'window',
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const defaultOptions: GenerateOptions = {
|
|
93
|
-
projectName: 'TestApp',
|
|
94
|
-
screenshotDir: './screenshots',
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
it('should generate a complete markdown document', () => {
|
|
98
|
-
const result = generator.generateFullDocument(mockSession, defaultOptions);
|
|
99
|
-
|
|
100
|
-
expect(result.content).toContain('# TestApp Feedback Report');
|
|
101
|
-
expect(result.content).toContain('Duration: 5:30');
|
|
102
|
-
expect(result.content).toContain('Items: 3');
|
|
103
|
-
expect(result.content).toContain('Screenshots: 3');
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('should include session context', () => {
|
|
107
|
-
const result = generator.generateFullDocument(mockSession, defaultOptions);
|
|
108
|
-
|
|
109
|
-
expect(result.content).toContain('**Session ID:** `test-session-123`');
|
|
110
|
-
expect(result.content).toContain('darwin');
|
|
111
|
-
expect(result.content).toContain('TestApp');
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it('should format feedback items with FB-XXX IDs', () => {
|
|
115
|
-
const result = generator.generateFullDocument(mockSession, defaultOptions);
|
|
116
|
-
|
|
117
|
-
expect(result.content).toContain('### FB-001:');
|
|
118
|
-
expect(result.content).toContain('### FB-002:');
|
|
119
|
-
expect(result.content).toContain('### FB-003:');
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
it('should include transcription in blockquote', () => {
|
|
123
|
-
const result = generator.generateFullDocument(mockSession, defaultOptions);
|
|
124
|
-
|
|
125
|
-
expect(result.content).toContain('> The button is broken');
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it('should include category/type for each item', () => {
|
|
129
|
-
const result = generator.generateFullDocument(mockSession, defaultOptions);
|
|
130
|
-
|
|
131
|
-
expect(result.content).toContain('**Type:** Bug');
|
|
132
|
-
expect(result.content).toContain('**Type:** UX Issue');
|
|
133
|
-
expect(result.content).toContain('**Type:** Suggestion');
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
it('should include screenshot references', () => {
|
|
137
|
-
const result = generator.generateFullDocument(mockSession, defaultOptions);
|
|
138
|
-
|
|
139
|
-
expect(result.content).toContain('');
|
|
140
|
-
expect(result.content).toContain('');
|
|
141
|
-
expect(result.content).toContain('');
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it('should include summary table', () => {
|
|
145
|
-
const result = generator.generateFullDocument(mockSession, defaultOptions);
|
|
146
|
-
|
|
147
|
-
expect(result.content).toContain('## Summary');
|
|
148
|
-
expect(result.content).toContain('| Bug | 1 |');
|
|
149
|
-
expect(result.content).toContain('| UX Issue | 1 |');
|
|
150
|
-
expect(result.content).toContain('| Suggestion | 1 |');
|
|
151
|
-
expect(result.content).toContain('| **Total** | **3** |');
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
it('should generate correct filename', () => {
|
|
155
|
-
const result = generator.generateFullDocument(mockSession, defaultOptions);
|
|
156
|
-
|
|
157
|
-
expect(result.filename).toMatch(/^testapp-feedback-\d{8}-\d{6}\.md$/);
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it('should return correct metadata', () => {
|
|
161
|
-
const result = generator.generateFullDocument(mockSession, defaultOptions);
|
|
162
|
-
|
|
163
|
-
expect(result.metadata.itemCount).toBe(3);
|
|
164
|
-
expect(result.metadata.screenshotCount).toBe(3);
|
|
165
|
-
expect(result.metadata.duration).toBe(5.5 * 60 * 1000); // 5:30 in ms
|
|
166
|
-
expect(result.metadata.types).toEqual({
|
|
167
|
-
Bug: 1,
|
|
168
|
-
'UX Issue': 1,
|
|
169
|
-
Suggestion: 1,
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
it('should handle empty session', () => {
|
|
174
|
-
const emptySession: Session = {
|
|
175
|
-
id: 'empty-session',
|
|
176
|
-
startTime: Date.now(),
|
|
177
|
-
endTime: Date.now() + 1000,
|
|
178
|
-
feedbackItems: [],
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
const result = generator.generateFullDocument(emptySession, defaultOptions);
|
|
182
|
-
|
|
183
|
-
expect(result.content).toContain('# TestApp Feedback Report');
|
|
184
|
-
expect(result.content).toContain('_No feedback items were captured during this session._');
|
|
185
|
-
expect(result.content).not.toContain('## Actionable Feedback');
|
|
186
|
-
expect(result.metadata.itemCount).toBe(0);
|
|
187
|
-
expect(result.metadata.screenshotCount).toBe(0);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
it('should handle special characters in project name', () => {
|
|
191
|
-
const options = {
|
|
192
|
-
projectName: "Eddie's App (Beta)",
|
|
193
|
-
screenshotDir: './screenshots',
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
const result = generator.generateFullDocument(mockSession, options);
|
|
197
|
-
|
|
198
|
-
expect(result.content).toContain("# Eddie's App (Beta) Feedback Report");
|
|
199
|
-
// Special chars get converted to dashes, consecutive dashes get collapsed
|
|
200
|
-
expect(result.filename).toMatch(/^eddie-s-app-beta--feedback-/);
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
describe('generateClipboardSummary', () => {
|
|
205
|
-
const mockSession: Session = {
|
|
206
|
-
id: 'test-session',
|
|
207
|
-
startTime: Date.now() - 60000,
|
|
208
|
-
endTime: Date.now(),
|
|
209
|
-
feedbackItems: [
|
|
210
|
-
{
|
|
211
|
-
id: '1',
|
|
212
|
-
transcription: 'First feedback item about a bug.',
|
|
213
|
-
timestamp: Date.now() - 50000,
|
|
214
|
-
screenshots: [],
|
|
215
|
-
category: 'Bug',
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
id: '2',
|
|
219
|
-
transcription: 'Second feedback item about UX.',
|
|
220
|
-
timestamp: Date.now() - 40000,
|
|
221
|
-
screenshots: [],
|
|
222
|
-
category: 'UX Issue',
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
id: '3',
|
|
226
|
-
transcription: 'Third feedback item suggestion.',
|
|
227
|
-
timestamp: Date.now() - 30000,
|
|
228
|
-
screenshots: [],
|
|
229
|
-
category: 'Suggestion',
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
id: '4',
|
|
233
|
-
transcription: 'Fourth feedback item question.',
|
|
234
|
-
timestamp: Date.now() - 20000,
|
|
235
|
-
screenshots: [],
|
|
236
|
-
category: 'Question',
|
|
237
|
-
},
|
|
238
|
-
],
|
|
239
|
-
metadata: {
|
|
240
|
-
sourceName: 'MyApp',
|
|
241
|
-
},
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
it('should generate summary under 1500 chars', () => {
|
|
245
|
-
const summary = generator.generateClipboardSummary(mockSession, 'MyApp');
|
|
246
|
-
|
|
247
|
-
expect(summary.length).toBeLessThanOrEqual(1500);
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
it('should include project name and item count', () => {
|
|
251
|
-
const summary = generator.generateClipboardSummary(mockSession, 'MyApp');
|
|
252
|
-
|
|
253
|
-
expect(summary).toContain('# Feedback: MyApp - 4 items');
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
it('should show first 3 items as priority', () => {
|
|
257
|
-
const summary = generator.generateClipboardSummary(mockSession, 'MyApp');
|
|
258
|
-
|
|
259
|
-
expect(summary).toContain('## Priority Items');
|
|
260
|
-
expect(summary).toContain('FB-001');
|
|
261
|
-
expect(summary).toContain('FB-002');
|
|
262
|
-
expect(summary).toContain('FB-003');
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
it('should reference remaining items', () => {
|
|
266
|
-
const summary = generator.generateClipboardSummary(mockSession, 'MyApp');
|
|
267
|
-
|
|
268
|
-
expect(summary).toContain('## Other');
|
|
269
|
-
expect(summary).toContain('FB-004');
|
|
270
|
-
expect(summary).toContain('see full report');
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
it('should include link to full report', () => {
|
|
274
|
-
const summary = generator.generateClipboardSummary(mockSession, 'MyApp');
|
|
275
|
-
|
|
276
|
-
expect(summary).toContain('**Full report:** ./feedback-report.md');
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
it('should use sourceName when projectName not provided', () => {
|
|
280
|
-
const summary = generator.generateClipboardSummary(mockSession);
|
|
281
|
-
|
|
282
|
-
expect(summary).toContain('# Feedback: MyApp');
|
|
283
|
-
});
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
describe('singleton export', () => {
|
|
287
|
-
it('should export a singleton instance', () => {
|
|
288
|
-
expect(markdownGenerator).toBeDefined();
|
|
289
|
-
expect(markdownGenerator.generateFeedbackItemId(0)).toBe('FB-001');
|
|
290
|
-
});
|
|
291
|
-
});
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
describe('adaptFeedbackSession', () => {
|
|
295
|
-
it('should convert FeedbackSession to Session', () => {
|
|
296
|
-
const feedbackSession: FeedbackSession = {
|
|
297
|
-
id: 'test-123',
|
|
298
|
-
startedAt: Date.now() - 60000,
|
|
299
|
-
endedAt: Date.now(),
|
|
300
|
-
status: 'complete',
|
|
301
|
-
screenshots: [
|
|
302
|
-
{
|
|
303
|
-
id: 'ss-1',
|
|
304
|
-
timestamp: Date.now() - 30000,
|
|
305
|
-
imagePath: '/tmp/ss1.png',
|
|
306
|
-
width: 1920,
|
|
307
|
-
height: 1080,
|
|
308
|
-
},
|
|
309
|
-
],
|
|
310
|
-
transcription: [
|
|
311
|
-
{
|
|
312
|
-
id: 'seg-1',
|
|
313
|
-
text: 'This is broken.',
|
|
314
|
-
startTime: Date.now() - 50000,
|
|
315
|
-
endTime: Date.now() - 45000,
|
|
316
|
-
confidence: 0.95,
|
|
317
|
-
isFinal: true,
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
id: 'seg-2',
|
|
321
|
-
text: 'It should work better.',
|
|
322
|
-
startTime: Date.now() - 44000,
|
|
323
|
-
endTime: Date.now() - 40000,
|
|
324
|
-
confidence: 0.92,
|
|
325
|
-
isFinal: true,
|
|
326
|
-
},
|
|
327
|
-
],
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
const session = adaptFeedbackSession(feedbackSession);
|
|
331
|
-
|
|
332
|
-
expect(session.id).toBe('test-123');
|
|
333
|
-
expect(session.startTime).toBe(feedbackSession.startedAt);
|
|
334
|
-
expect(session.endTime).toBe(feedbackSession.endedAt);
|
|
335
|
-
expect(session.feedbackItems.length).toBeGreaterThan(0);
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
it('should group transcription segments by pause threshold', () => {
|
|
339
|
-
const now = Date.now();
|
|
340
|
-
const feedbackSession: FeedbackSession = {
|
|
341
|
-
id: 'test-456',
|
|
342
|
-
startedAt: now - 60000,
|
|
343
|
-
status: 'complete',
|
|
344
|
-
screenshots: [],
|
|
345
|
-
transcription: [
|
|
346
|
-
{
|
|
347
|
-
id: 'seg-1',
|
|
348
|
-
text: 'First thought.',
|
|
349
|
-
startTime: now - 50000,
|
|
350
|
-
endTime: now - 48000,
|
|
351
|
-
confidence: 0.95,
|
|
352
|
-
isFinal: true,
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
id: 'seg-2',
|
|
356
|
-
text: 'Still first thought.',
|
|
357
|
-
startTime: now - 47000, // Close to previous - same item
|
|
358
|
-
endTime: now - 45000,
|
|
359
|
-
confidence: 0.95,
|
|
360
|
-
isFinal: true,
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
id: 'seg-3',
|
|
364
|
-
text: 'New thought after pause.',
|
|
365
|
-
startTime: now - 30000, // Big gap - new item
|
|
366
|
-
endTime: now - 28000,
|
|
367
|
-
confidence: 0.95,
|
|
368
|
-
isFinal: true,
|
|
369
|
-
},
|
|
370
|
-
],
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
const session = adaptFeedbackSession(feedbackSession, { pauseThresholdMs: 5000 });
|
|
374
|
-
|
|
375
|
-
expect(session.feedbackItems.length).toBe(2);
|
|
376
|
-
expect(session.feedbackItems[0].transcription).toContain('First thought');
|
|
377
|
-
expect(session.feedbackItems[0].transcription).toContain('Still first thought');
|
|
378
|
-
expect(session.feedbackItems[1].transcription).toContain('New thought');
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
it('should infer category from transcription text', () => {
|
|
382
|
-
const now = Date.now();
|
|
383
|
-
const feedbackSession: FeedbackSession = {
|
|
384
|
-
id: 'test-789',
|
|
385
|
-
startedAt: now - 60000,
|
|
386
|
-
status: 'complete',
|
|
387
|
-
screenshots: [],
|
|
388
|
-
transcription: [
|
|
389
|
-
{
|
|
390
|
-
id: 'seg-1',
|
|
391
|
-
text: 'This feature is broken and crashes.',
|
|
392
|
-
startTime: now - 50000,
|
|
393
|
-
endTime: now - 48000,
|
|
394
|
-
confidence: 0.95,
|
|
395
|
-
isFinal: true,
|
|
396
|
-
},
|
|
397
|
-
],
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
const session = adaptFeedbackSession(feedbackSession);
|
|
401
|
-
|
|
402
|
-
expect(session.feedbackItems[0].category).toBe('Bug');
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
it('should handle empty transcription', () => {
|
|
406
|
-
const feedbackSession: FeedbackSession = {
|
|
407
|
-
id: 'empty-test',
|
|
408
|
-
startedAt: Date.now(),
|
|
409
|
-
status: 'complete',
|
|
410
|
-
screenshots: [],
|
|
411
|
-
transcription: [],
|
|
412
|
-
};
|
|
413
|
-
|
|
414
|
-
const session = adaptFeedbackSession(feedbackSession);
|
|
415
|
-
|
|
416
|
-
expect(session.feedbackItems).toHaveLength(0);
|
|
417
|
-
});
|
|
418
|
-
});
|
package/tests/output.test.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Output Module Tests
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { describe, it, expect } from 'vitest';
|
|
6
|
-
import type { FeedbackSession, Screenshot, TranscriptionSegment } from '../src/shared/types';
|
|
7
|
-
|
|
8
|
-
// Mock OutputManager for testing without Electron dependencies
|
|
9
|
-
class MockOutputManager {
|
|
10
|
-
generateMarkdown(session: FeedbackSession) {
|
|
11
|
-
const { id, screenshots, transcription, startedAt, endedAt } = session;
|
|
12
|
-
|
|
13
|
-
let markdown = '# Feedback Session\n\n';
|
|
14
|
-
markdown += `**Session ID:** ${id}\n`;
|
|
15
|
-
markdown += `**Started:** ${new Date(startedAt).toISOString()}\n`;
|
|
16
|
-
if (endedAt) {
|
|
17
|
-
markdown += `**Ended:** ${new Date(endedAt).toISOString()}\n`;
|
|
18
|
-
}
|
|
19
|
-
markdown += '\n---\n\n';
|
|
20
|
-
|
|
21
|
-
// Add transcription
|
|
22
|
-
for (const segment of transcription) {
|
|
23
|
-
markdown += `${segment.text}\n\n`;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Add screenshots
|
|
27
|
-
for (const screenshot of screenshots) {
|
|
28
|
-
markdown += `\n\n`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
sessionId: id,
|
|
33
|
-
generatedAt: Date.now(),
|
|
34
|
-
markdown,
|
|
35
|
-
screenshots,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
describe('OutputManager', () => {
|
|
41
|
-
it('should generate markdown from a session', () => {
|
|
42
|
-
const manager = new MockOutputManager();
|
|
43
|
-
|
|
44
|
-
const session: FeedbackSession = {
|
|
45
|
-
id: 'test-session-1',
|
|
46
|
-
startedAt: Date.now() - 60000,
|
|
47
|
-
endedAt: Date.now(),
|
|
48
|
-
status: 'complete',
|
|
49
|
-
screenshots: [
|
|
50
|
-
{
|
|
51
|
-
id: 'screenshot-1',
|
|
52
|
-
timestamp: Date.now() - 30000,
|
|
53
|
-
imagePath: '/tmp/screenshot-1.png',
|
|
54
|
-
width: 1920,
|
|
55
|
-
height: 1080,
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
transcription: [
|
|
59
|
-
{
|
|
60
|
-
id: 'segment-1',
|
|
61
|
-
text: 'This is a test transcription.',
|
|
62
|
-
startTime: Date.now() - 45000,
|
|
63
|
-
endTime: Date.now() - 35000,
|
|
64
|
-
confidence: 0.95,
|
|
65
|
-
isFinal: true,
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const output = manager.generateMarkdown(session);
|
|
71
|
-
|
|
72
|
-
expect(output.sessionId).toBe('test-session-1');
|
|
73
|
-
expect(output.markdown).toContain('# Feedback Session');
|
|
74
|
-
expect(output.markdown).toContain('test-session-1');
|
|
75
|
-
expect(output.markdown).toContain('This is a test transcription.');
|
|
76
|
-
expect(output.markdown).toContain('![Screenshot]');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should handle empty sessions', () => {
|
|
80
|
-
const manager = new MockOutputManager();
|
|
81
|
-
|
|
82
|
-
const session: FeedbackSession = {
|
|
83
|
-
id: 'empty-session',
|
|
84
|
-
startedAt: Date.now(),
|
|
85
|
-
status: 'complete',
|
|
86
|
-
screenshots: [],
|
|
87
|
-
transcription: [],
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const output = manager.generateMarkdown(session);
|
|
91
|
-
|
|
92
|
-
expect(output.sessionId).toBe('empty-session');
|
|
93
|
-
expect(output.markdown).toContain('# Feedback Session');
|
|
94
|
-
expect(output.screenshots).toHaveLength(0);
|
|
95
|
-
});
|
|
96
|
-
});
|