diff --git a/packages/common-ui/src/components/CourseCardBrowser.vue b/packages/common-ui/src/components/CourseCardBrowser.vue index c10834aa7..5614d847e 100644 --- a/packages/common-ui/src/components/CourseCardBrowser.vue +++ b/packages/common-ui/src/components/CourseCardBrowser.vue @@ -262,26 +262,19 @@ export default defineComponent({ }, async loadCardTags(cardIds: string[]) { try { - // Get all tags for the course - const allTags = await this.courseDB!.getCourseTagStubs(); - - // For each card, find tags that include this card - cardIds.forEach(cardId => { - const cardTags: TagStub[] = []; - - // Check each tag to see if it contains this card - allTags.rows.forEach(tagRow => { - if (tagRow.doc && tagRow.doc.taggedCards.includes(cardId)) { - cardTags.push({ - name: tagRow.doc.name, - snippet: tagRow.doc.snippet, - count: tagRow.doc.taggedCards.length - }); - } - }); - - this.cardTags[cardId] = cardTags; - }); + // Use the proper API method to get tags for each card + await Promise.all( + cardIds.map(async (cardId) => { + const appliedTags = await this.courseDB!.getAppliedTags(cardId); + + // Convert to TagStub format + this.cardTags[cardId] = appliedTags.rows.map(row => ({ + name: row.value.name, + snippet: row.value.snippet, + count: row.value.count + })); + }) + ); } catch (error) { console.error('Error loading card tags:', error); } diff --git a/packages/common-ui/src/components/StudySession.vue b/packages/common-ui/src/components/StudySession.vue index 8cc694dd8..8ebec2184 100644 --- a/packages/common-ui/src/components/StudySession.vue +++ b/packages/common-ui/src/components/StudySession.vue @@ -595,7 +595,7 @@ export default defineComponent({ this.cardCount++; this.data = tmpData; - this.view = tmpView; + this.view = markRaw(tmpView); this.cardID = _cardID; this.courseID = _courseID; this.card_elo = tmpCardData.elo.global.score; diff --git a/packages/common-ui/src/components/auth/UserChip.vue b/packages/common-ui/src/components/auth/UserChip.vue index 1b05320cd..b31e0b9da 100644 --- a/packages/common-ui/src/components/auth/UserChip.vue +++ b/packages/common-ui/src/components/auth/UserChip.vue @@ -97,6 +97,12 @@ import { getCurrentUser, useAuthStore } from '../../stores/useAuthStore'; import { useConfigStore } from '../../stores/useConfigStore'; import { useAuthUI } from '../../composables/useAuthUI'; +// Define props (even if not used, prevents warnings) +defineProps<{ + showLoginButton?: boolean; + redirectToPath?: string; +}>(); + const router = useRouter(); const authStore = useAuthStore(); const configStore = useConfigStore(); diff --git a/packages/common-ui/src/components/auth/UserLoginAndRegistrationContainer.vue b/packages/common-ui/src/components/auth/UserLoginAndRegistrationContainer.vue index 13905a066..9c4587a51 100644 --- a/packages/common-ui/src/components/auth/UserLoginAndRegistrationContainer.vue +++ b/packages/common-ui/src/components/auth/UserLoginAndRegistrationContainer.vue @@ -1,21 +1,25 @@ diff --git a/packages/standalone-ui/src/router/index.ts b/packages/standalone-ui/src/router/index.ts index 5d21bdfee..76b516bbf 100644 --- a/packages/standalone-ui/src/router/index.ts +++ b/packages/standalone-ui/src/router/index.ts @@ -3,6 +3,8 @@ import HomeView from '../views/HomeView.vue'; import StudyView from '../views/StudyView.vue'; import ProgressView from '../views/ProgressView.vue'; import BrowseView from '../views/BrowseView.vue'; +import UserStatsView from '../views/UserStatsView.vue'; +import UserSettingsView from '../views/UserSettingsView.vue'; import { UserLogin, UserRegistration } from '@vue-skuilder/common-ui'; const routes: Array = [ @@ -37,6 +39,16 @@ const routes: Array = [ name: 'Register', component: UserRegistration, }, + { + path: '/u/:username', + name: 'UserSettings', + component: UserSettingsView, + }, + { + path: '/u/:username/stats', + name: 'UserStats', + component: UserStatsView, + }, ]; const router = createRouter({ diff --git a/packages/standalone-ui/src/views/BrowseView.vue b/packages/standalone-ui/src/views/BrowseView.vue index ad27f4c46..a54a2b8c0 100644 --- a/packages/standalone-ui/src/views/BrowseView.vue +++ b/packages/standalone-ui/src/views/BrowseView.vue @@ -1,7 +1,14 @@