Skip to content

Commit f9c5a19

Browse files
author
root
committed
feat(tools): implement remaining tool pages and visually separate court evidence tools
1 parent 60738b3 commit f9c5a19

16 files changed

Lines changed: 4063 additions & 135 deletions

components/GlobalFooter.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ export default {
7373
name: "tools/inactivity",
7474
text: "pageNameInactivity",
7575
},
76+
{
77+
name: "tools/message-counter",
78+
text: "pageNameMessages",
79+
},
80+
{
81+
name: "tools/word-counter",
82+
text: "pageNameWords",
83+
},
84+
{
85+
name: "tools/chat-heatmap",
86+
text: "pageNameHeatmap",
87+
},
7688
{
7789
name: "switch-from-whatsapp-to-signal",
7890
text: "pageNameSignal",

components/tools/ToolDropzone.vue

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,23 @@ import {
114114
type ChatInactivityAnalysis,
115115
} from "~/composables/useChatTool";
116116
import { analyzeInactivity } from "~/utils/inactivity";
117+
import { analyzeMessages } from "~/utils/messageCounter";
118+
import { analyzeWords } from "~/utils/wordCounter";
119+
import { analyzeHeatmap } from "~/utils/chatHeatmap";
120+
121+
interface Props {
122+
toolType?: "inactivity" | "messages" | "words" | "heatmap";
123+
}
124+
125+
const props = withDefaults(defineProps<Props>(), {
126+
toolType: "inactivity",
127+
});
117128
118129
const emit = defineEmits<{
119130
(
120131
e: "analyzed",
121132
payload: {
122-
analysis: ChatInactivityAnalysis;
133+
analysis: any;
123134
messages: ChatMessage[];
124135
attachments: ChatAttachment[];
125136
}
@@ -169,10 +180,20 @@ async function processInput(
169180
);
170181
}
171182
172-
const analysis = analyzeInactivity(messages, durationMs);
183+
let analysis: any = null;
184+
if (props.toolType === "messages") {
185+
analysis = analyzeMessages(messages, durationMs);
186+
} else if (props.toolType === "words") {
187+
analysis = analyzeWords(messages, durationMs);
188+
} else if (props.toolType === "heatmap") {
189+
analysis = analyzeHeatmap(messages, durationMs);
190+
} else {
191+
analysis = analyzeInactivity(messages, durationMs);
192+
}
193+
173194
if (!analysis) {
174195
throw new Error(
175-
"Could not compute inactivity metrics: Chat contains no participant messages."
196+
"Could not compute metrics: Chat contains no participant messages."
176197
);
177198
}
178199

composables/useChatTool.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ export {
8181
formatDuration,
8282
formatTimeAgo,
8383
} from "~/utils/inactivity";
84+
export { analyzeMessages } from "~/utils/messageCounter";
85+
export { analyzeWords } from "~/utils/wordCounter";
86+
export { analyzeHeatmap } from "~/utils/chatHeatmap";
8487

8588
// Extractor helper to parse a File (.txt or .zip) or string
8689
export async function parseChatFile(

nuxt.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ const localizedPages = [
1919
"tools/court-evidence",
2020
"tools/inactivity",
2121
"tools/proof-of-relationship",
22+
"tools/message-counter",
23+
"tools/word-counter",
24+
"tools/chat-heatmap",
2225
"whatsapp-to-pdf",
2326
"whatsapp-wrapped-year-review",
2427
];

0 commit comments

Comments
 (0)