testing updates
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
v-if="itemStatus.isDifferentVersion"
|
||||
v-tippy="'Conversation started in a different version.'"
|
||||
>
|
||||
<ExclamationCircleIcon class="w-4 h-4" />
|
||||
<ArrowLeftCircleIcon class="w-4 h-4" />
|
||||
</span>
|
||||
<span
|
||||
v-if="itemStatus.isFederatedModel"
|
||||
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { CheckCircleIcon } from '@heroicons/vue/24/solid'
|
||||
import { CheckCircleIcon, ArrowLeftCircleIcon } from '@heroicons/vue/24/solid'
|
||||
import { CheckCircleIcon as CheckCircleIconOutlined } from '@heroicons/vue/24/outline'
|
||||
import { ExclamationCircleIcon } from '@heroicons/vue/20/solid'
|
||||
import type { LoadedCommentThread } from '~~/lib/viewer/composables/setup'
|
||||
|
||||
@@ -278,12 +278,17 @@ export const useCommentContext = () => {
|
||||
.filter((l) => l.resourceType === 'commit')
|
||||
.map((l) => l.resourceId)
|
||||
|
||||
const hasLoadedObjects = loadedResources.some((lr) =>
|
||||
objectLinks.includes(lr.objectId)
|
||||
)
|
||||
const hasLoadedVersions = loadedResources.some(
|
||||
(lr) => lr.versionId && commitLinks.includes(lr.versionId)
|
||||
)
|
||||
// Check if ALL of the thread's objects are loaded (not just any)
|
||||
const hasLoadedObjects =
|
||||
objectLinks.length > 0 &&
|
||||
objectLinks.every((objId) => loadedResources.some((lr) => lr.objectId === objId))
|
||||
|
||||
// Check if ALL of the thread's commits are loaded (not just any)
|
||||
const hasLoadedVersions =
|
||||
commitLinks.length > 0 &&
|
||||
commitLinks.every((commitId) =>
|
||||
loadedResources.some((lr) => lr.versionId && lr.versionId === commitId)
|
||||
)
|
||||
|
||||
// Resource is loaded, check versions and federation
|
||||
const currentModels = state.resources.response.modelsAndVersionIds.value
|
||||
@@ -315,7 +320,7 @@ export const useCommentContext = () => {
|
||||
)
|
||||
|
||||
const loadContext = async (
|
||||
mode: StateApplyMode.TheadFullContextOpen | StateApplyMode.FederatedContext
|
||||
mode: StateApplyMode.ThreadFullContextOpen | StateApplyMode.FederatedContext
|
||||
) => {
|
||||
const state = thread.value?.viewerState
|
||||
if (!state) return
|
||||
@@ -325,7 +330,7 @@ export const useCommentContext = () => {
|
||||
}
|
||||
|
||||
const onLoadThreadVersionContext = () =>
|
||||
loadContext(StateApplyMode.TheadFullContextOpen)
|
||||
loadContext(StateApplyMode.ThreadFullContextOpen)
|
||||
const onLoadFederatedContext = () => loadContext(StateApplyMode.FederatedContext)
|
||||
|
||||
const goBack = async () => {
|
||||
|
||||
@@ -130,7 +130,7 @@ export function useStateSerialization() {
|
||||
export enum StateApplyMode {
|
||||
Spotlight,
|
||||
ThreadOpen,
|
||||
TheadFullContextOpen,
|
||||
ThreadFullContextOpen,
|
||||
Reset,
|
||||
FederatedContext
|
||||
}
|
||||
@@ -259,7 +259,7 @@ export function useApplySerializedState() {
|
||||
|
||||
// Handle resource string updates
|
||||
if (
|
||||
[StateApplyMode.Spotlight, StateApplyMode.TheadFullContextOpen].includes(mode)
|
||||
[StateApplyMode.Spotlight, StateApplyMode.ThreadFullContextOpen].includes(mode)
|
||||
) {
|
||||
await resourceIdString.update(state.resources.request.resourceIdString)
|
||||
} else if (mode === StateApplyMode.FederatedContext) {
|
||||
|
||||
Reference in New Issue
Block a user