Skip to content

Commit 9461f2f

Browse files
committed
refactor: remove unused note rephrasing logic and streamline assimilation component
- Eliminated the note rephrasing feature and associated state management, simplifying the assimilation process. - Removed unnecessary methods and variables related to checklist point selection and loading states. - Updated the component structure for improved clarity and maintainability. Co-authored-by: terry <terry@odd-e.com>
1 parent bfc50e7 commit 9461f2f

File tree

1 file changed

+0
-72
lines changed

1 file changed

+0
-72
lines changed

frontend/src/components/recall/Assimilation.vue

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
@note-type-updated="onNoteTypeUpdated"
1717
@note-info-loaded="onNoteInfoLoaded"
1818
/>
19-
<div v-if="isNoteRephrased" class="daisy-mb-4 daisy-p-3 daisy-rounded-lg daisy-bg-success daisy-text-success-content">
20-
<span class="daisy-font-semibold">Note Rephrased</span>
21-
</div>
2219
<div
2320
v-if="understandingPoints.length > 0"
2421
class="daisy-mb-4 daisy-rounded-lg daisy-bg-accent daisy-p-4"
@@ -33,16 +30,9 @@
3330
:key="index"
3431
class="daisy-text-accent-content"
3532
>
36-
<input
37-
type="checkbox"
38-
class="daisy-checkbox daisy-checkbox-xs daisy-checkbox-accent"
39-
:checked="selectedCheckListPoints.has(index)"
40-
@change="togglePointSelection(index)"
41-
/>
4233
{{ point }}
4334
</li>
4435
</ul>
45-
<input v-if="featureToggle" type="button" class="daisy-btn daisy-btn-xs daisy-btn-accent" id="rephrase-note" value="Rephrase Note" @click="handleRephraseNote" />
4636
</div>
4737
</div>
4838
<AssimilationButtons
@@ -66,8 +56,6 @@ import Breadcrumb from "../toolbars/Breadcrumb.vue"
6656
import { computed, ref } from "vue"
6757
import { useRecallData } from "@/composables/useRecallData"
6858
import { useAssimilationCount } from "@/composables/useAssimilationCount"
69-
import { useStorageAccessor } from "@/composables/useStorageAccessor"
70-
import { useFeatureToggle } from "@/composables/useFeatureToggle"
7159
7260
const { note } = defineProps<{
7361
note: Note
@@ -86,61 +74,16 @@ const { incrementAssimilatedCount } = useAssimilationCount()
8674
8775
// State
8876
const buttonKey = computed(() => note.id)
89-
const isNoteRephrased = ref(false)
90-
const selectedCheckListPoints = ref<Set<number>>(new Set())
91-
92-
const togglePointSelection = (index: number) => {
93-
if (selectedCheckListPoints.value.has(index)) {
94-
selectedCheckListPoints.value.delete(index)
95-
} else {
96-
selectedCheckListPoints.value.add(index)
97-
}
98-
}
99-
100-
const storageAccessor = useStorageAccessor()
101-
const { featureToggle } = useFeatureToggle()
102-
103-
const handleRephraseNote = async () => {
104-
// Get the selected points to remove
105-
const pointsToRemove = Array.from(selectedCheckListPoints.value)
106-
.map((index) => understandingPoints.value[index])
107-
.join("; ")
108-
109-
if (!pointsToRemove) return
110-
111-
// Clear the checklist to hide it while rephrasing
112-
understandingPoints.value = []
113-
selectedCheckListPoints.value = new Set()
114-
115-
try {
116-
const result = await apiCallWithLoading(() =>
117-
AiController.removePointFromNote({
118-
path: { note: note.id },
119-
body: pointsToRemove,
120-
})
121-
)
122-
123-
if (!result.error && result.data) {
124-
storageAccessor.value.refreshNoteRealm(result.data)
125-
isNoteRephrased.value = true
126-
await generateUnderstandingChecklist()
127-
}
128-
} catch (err) {
129-
console.error("Failed to rephrase note:", err)
130-
}
131-
}
13277
13378
// Understanding checklist from backend
13479
const understandingPoints = ref<string[]>([])
135-
const isLoadingChecklist = ref(false)
13680
13781
const generateUnderstandingChecklist = async () => {
13882
if (!note.details || note.details.trim().length === 0) {
13983
understandingPoints.value = []
14084
return
14185
}
14286
143-
isLoadingChecklist.value = true
14487
try {
14588
const result = await apiCallWithLoading(() =>
14689
AiController.generateUnderstandingChecklist({
@@ -156,8 +99,6 @@ const generateUnderstandingChecklist = async () => {
15699
} catch (err) {
157100
console.error("Failed to generate understanding checklist:", err)
158101
understandingPoints.value = []
159-
} finally {
160-
isLoadingChecklist.value = false
161102
}
162103
}
163104
@@ -169,18 +110,6 @@ const onNoteTypeUpdated = () => {
169110
generateUnderstandingChecklist()
170111
}
171112
172-
const getIgnoredChecklistTopics = (): string | undefined => {
173-
const points = Array.from(selectedCheckListPoints.value)
174-
.map((index) => understandingPoints.value[index])
175-
.filter((point): point is string => Boolean(point))
176-
177-
if (points.length === 0) {
178-
return undefined
179-
}
180-
181-
return points.join(", ")
182-
}
183-
184113
// Methods
185114
const processForm = async (skipMemoryTracking: boolean) => {
186115
if (skipMemoryTracking) {
@@ -196,7 +125,6 @@ const processForm = async (skipMemoryTracking: boolean) => {
196125
AssimilationController.assimilate({
197126
body: {
198127
noteId: note.id,
199-
ignoredChecklistTopics: getIgnoredChecklistTopics(),
200128
skipMemoryTracking,
201129
},
202130
})

0 commit comments

Comments
 (0)