* 3871 activity session issues feedback (#3874) * fix: add header when fetching image from CMS * fix: only show activity start page is all roles have never been full * chore: disable archive button until summary loads * chore: still save activity analytics summary even if there's a choreo error when fetching summary * chore: pass location image URL as topic image URL (#3876) * feat: add local cache for activity session analytics (#3878) * fix: in new courses, set course_user state event power level to 0 (#3882) * fix: make activity summary request cache keys unique, use in-memory cache instead of local storage, remove items from cache on error or on state event sent successfully (#3885) * chore: widen summary cards (#3888) * Replaced references to spaces with courses in intl files and calls (#3884) * Replaced references to spaces with courses in intl files and calls * Change learning community reference to 'public course' --------- Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * chore: update delete course description (#3889) * 3890 activity start page changes (#3901) * comment out unreferenced files * decouple courses, topics, and activities * update start page * disable 'join open session' button * feat: activity dropdown menu * fix: always initialize course info after fetching (#3907) * chore: show role goal in text abut button on activity launch page and in tooltip above input bar (#3910) * chore: go to course settings tab after archiving activity, show check over completed activites (#3913) * fix: remove dollar sign from copy (#3914) * fix: update payload accessToken on new login (#3916) * 3915 course chat view updates (#3919) * Removes Proper Noun from default analytics morph list (#3918) Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * Level up popup tweaks (#3917) * Use L10n for 'Level up' text * Replace drop down button with close button --------- Co-authored-by: ggurdin <ggurdin@gmail.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * chore: update how activity summary description expansion button layout works (#3930) * fix: add analytics listener to activity stats menu (#3931) * fix: don't show join message when user dismisses activity role goal message (#3932) * chore: hide activity role tooltip when it bar is open (#3933) * fix: fix null check error in activity role tooltip (#3935) * fix: when fetching translation, only consider a message to have included IT if the sent message body matches the message at the end of choreo (#3936) * chore: update messaging in subscription management (#3937) * feat: join activity session on open app via ping (#3944) * chore: don't show ping unread badge (#3946) * fix: Correctly fetch activity images (#3943) * fix fetching images and parsing url * small fix for getting activity image URLs --------- Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> Co-authored-by: ggurdin <ggurdin@gmail.com> * Set thumbVisibility true for grammar activity scrolling (#3942) * Set thumbVisibility true for grammar activity scrolling * always show scrollbar --------- Co-authored-by: ggurdin <ggurdin@gmail.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * reload space hierarchy on invite update (#3949) * 3927 analytics tweaks (#3953) * analytics page updates * add back download buttons * some activity / invite page tweaks (#3958) * Wrap invite course avatar in MapClipper (#3957) Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * Add period to end of languageLevelA2Desc (#3959) * fix: put back pangea controller init in chat list (#3965) * fix: show bot avatar in open roles indicator (#3966) * fix: on cancel registration, pop future loading dialog (#3967) * chore: adjust actvity participant text colot (#3968) * fix: always reload course on ID change (#3969) * chore: increase size of text in archived activity popup (#3970) * feat: add edit course page (#3971) * 3962 usability test todos (#3973) * in new course pages, show images * in space analytics, if no available languages, pick user's l2 * chore: add cooldown on ping participants * replace image loading icon with shimmer * update activity launch page buttons, sort activities in topics by number of participants (#3974) * chore: topic is completed if user has finished number of activities equal to number of 2 person activities in topic (#3983) * feat: always show new tokens with green underlines (#3984) * 3873 add superlatives for most vocab grammar and xp (#3977) * add grammar and vocab superlatives - adds superlatives to the summary cards for each user - WIP, doesn't include XP superlative yet and it continuously reinitializes state which reloads the superlatives * get analytic superlatives from saved state event Revert activity user summaries widget to stateless, get info from saved state event instead of awaiting it, and fix some spacing issues. * add xp superlative - simplify 3 loop logic into one - change from constant updates to only generate superlatives on analytics save * sort imports * put analytics loading inside buttonControlledCarouselView * delete commented out code * return superlative map instead of setting value * chore: on new token update, clear whole new token cache in case there are identical tokens (#3985) * fix: fix calculation of completed activities (#3986) * chore: collection seed always fades up and out (#3987) Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * 3988 activitycourse tweaks (#3989) * chore: set course and activity descriptions * chore: remove redundant results button * 3921 display unsubscribed errors for users (#3991) * url cleanup * chore: display unsubscribed errors differently * chore: show user menu on click participant item (#3992) * fix: Reintroduce shared isolate (#3981) * initial scripts n actions * custom cshared isolate * kitlin fixes * integrate and token fix * executable and gstreamer * disable check dupes, fix gstreamer * another linux update, removed 2 android builds * new updates * final android attempt * formatting --------- Co-authored-by: ggurdin <ggurdin@gmail.com> * chore: add snackbar message after pinging course participants (#3995) * fix: don't show green underlines on own messages (#3997) * 3803 indented bullets displayed strangely (#3999) * make markdown function the same as matrix sdk * fix: fix newline issues in html messages * fix: replace build-web script (#4000) * fix: try to fix build again (#4001) * chore: don't allow hover of non-selectable activity participants items (#4002) * 3895 emoji sequence on clicking the words in a sentence of the target language (#4004) * cleanup * feat: toolbar emoji mode * Add dark/light mode check for unassigned participant label color (#4006) * chore: update emoji button color (#4015) * chore: move analytics tooltips inside scrollviews (#4016) * chore: update icon and border of find a course nav rail item (#4005) * chore: Improve translation script and translate vi, es, et (#3555) * improve translation script * update translation script, more translates for es, et, vi * chore: fix click cursor showing on hover of disabled activity participant widget (#4020) * chore: add hint text to text fields in course edit page (#4022) * chore: add placeholder to image in course editting page (#4024) * chore: show snackbar on course edit save (#4025) * 4017 usability test todos 91725 (#4026) * chore: add ability to toggle show password in signup and login pages * chore: update text in register popup * chore: disable save edits button if no changes in course edit page (#4033) * chore: don't animate in-chat tooltips (#4034) * chore: add scrollbar to topic activities list (#4035) * Morph analytics scroll (#4032) * Move download button above scroll view * Make morph analytics spacing consistent with vocab analytics spacing * feat: add ability to add course to existing space (#4037) * fix: don't attempt to load analytics until your is logged in (#4047) * feat: integrate room preview endpoint (#4014) * feat: integrate room preview endpoint * initial work for intermediary activity page * Update lib/pangea/activity_sessions/activity_session_start/activity_session_start_page.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update lib/pangea/activity_sessions/activity_session_start/activity_session_start_page.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update lib/pangea/chat_settings/utils/room_summary_extension.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * formatting --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * 3934 activity summary card visual changes (#4013) * visual tweaks and confetti rain on results generation * create star rain widget to trigger when activity finishes * delete commented out lines * use new star confetti widget in levelup --------- Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * Set height of activity creation sized box to 0 (#4048) * 4036 playtest 91825 (#4051) * chore: improve constrast in message practice * fix typo * chore: disable learning settings save button until change is made * show word card on click vocab in activity dropdown * Playtest updates (#4054) * update emoji mode icon and tooltip * upload CMS url instead of uploading image bytes to matrix * re-init subscription controller after setting account creation date * fix: don't allow new users to steal roles (#4055) * chore: render activity instruction markdown (#4056) * chore: disable hover effect on loading span card icons (#4057) * fix: fix needed participants copy (#4058) * update course plan repo search to correctly query (#4065) * chore: fix practice mode icon / border contrast (#4067) * chore: only show emoji button for save-vocab tokens, fix alignment for non-token text (#4071) * fix: fix button visibility in activity start page (#4073) * chore: use synapse room_preview to determine which activities users have completed (#4078) * fix: don't reset edits using the room's title and description (#4080) * chore: on web, show analytics in course chat view (#4085) * chore: show user menu on click avatar in topic participant list (#4086) * fix: fix toolbar buttons on mobile (#4087) * chore: on course load error, show option to add a different course plan to space (#4089) * fix: check if can invite to course when deciding if show invite button in activity session in course without enough users, disable instead of hiding (#4095) * chore: shuffle practice tokens before selecting the ones to include (#4097) * feat: show instruction overlay on first gain points in activity pointing user to click activity stats button (#4099) * chore: add descriptions for analytics categories (#4100) * chore: fix copy issue (#4102) * fix: make invite button go to course invite page (#4103) * chore: make autoIGC true for new accounts (#4105) * 4110 playtest 92325 (#4121) * style activity role tooltip like instruction inline tooltips * style updates to activity details * don't show token underlines in practice mode * show loading activity analytics * use all construct types to calculate activity analytics, include audio messages in activity summary request * update chat context menus for activities * fix positioning on menu in main chat list * chore: update activity session notification to open activity start page without joining activity (#4122) * chore: add copy to describe writing analytics (#4123) * feat: new onboarding flow (#4112) * feat: new onboarding flow * go to course details page on click course template in setup page * update route redirects * style tweaks * chore: add gold shimmer to active token practice buttons (#4131) * chore: remove unnecessary spacing (#4132) * fix: don't show end activity button until activity has started (#4134) * chore: add no courses found indicator (#4135) * chore: update course edit saving logic (#4136) * chore: add loading indicator to course settings page (#4137) * fix: use outer context when navigating via course chat popup (#4139) * chore: update some copy in filter dropdowns (#4140) * chore: make terms and conditions links work (#4141) * chore: remove unnecessary padding (#4143) * fix: hide activity role tooltip during translation (#4145) * fix: always allow show menu on click activity participant (#4146) * chore: remove text scaling in emoji mode (#4147) * chore: increase size of user activity summary widgets (#4149) * chore: make whole upper acitivty summary clickable to expand (#4150) * fix: always set vocab as default tab in analytics page (#4151) * build: fix lints for new flutter version (#4154) * chore: changes to chat list main view (#4158) * chore: changes to chat list main view * remove onboarding page * Make underlines translucent so lower parts of letters can be seen (#4160) * 4142-allow-giving-of-activity-feedback (#4144) * feat: activity feedback repo * add UI for giving activity feedback --------- Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> Co-authored-by: ggurdin <ggurdin@gmail.com> * fix: don't dispose new word overlay animation early (#4168) * 4152 onboarding tweaks (#4163) * filter courses by short lang codes * reduce padding in course details page * update home / registration routes * refactor: replace find your people page with new course page from onboarding * chore: on course search, always load course IDs from server (#4174) * fix: fix double analytics view in two column mode (#4175) * feat: on create course, go to invite page while course creation loads (#4178) * chore: give activity goal tooltip max width (#4179) * chore: remove horizontal offset from pressable button widget (#4180) * chore: in space analytics tab on small screens show language code in language dropdown (#4182) * chore: in reading asssitance input bar, if all practice activities for message are completed, show all done message (#4183) * 4181 japanese words grouped when should be separate (#4184) * fix: only continue pickup up adjacent tokens while they are punctuation * uncomment commented out code * chore: when igc has matches, make send button color disabled instead of red (#4185) * chore: don't show choreo error on timeout after canceling translation (#4189) * consume image sizes from cms, surface course plan activity locations apis (#4187) * 4152 onboarding tweaks (#4190) * filter courses by short lang codes * reduce padding in course details page * update home / registration routes * refactor: replace find your people page with new course page from onboarding * chore: add redirect to onboarding course plan page if user not in course * chore: re-style onboarding buttons (#4196) * chore: match vocab lemma irrespective of case, use static message in activity stats dropdown (#4205) * chore: show word card in click vocab word in activity summary (#4206) * feat: integrate course translation group (#4209) * integrate course translation group * Update lib/pangea/payload_client/models/course_plan/cms_course_plan_translation_group.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * formatting --------- Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: ggurdin <ggurdin@gmail.com> * chore: wait for user to send at least 3 text or audio messages before showing overlay with instructions about clicking activity status button * fix: disable ping course participants button if there are no no-bot users in course to ping * chore: show 'all done' message in practice activity bar for each activity type (#4212) * Decrease unselected igc underline to 20% opacity (#4214) * 4199 prevent activity menu tooltip from being interfered with my other overlays to ensure it always shows (#4215) * don't show activity dropdown instructions if word card is open * block other overlays from openning when tutorial overlay is open * remove duplicate open overlay data, don't wait for construct banners to close if overlay fails to open * chore: show selected archived activity, add tooltip to archived activity analytics view (#4217) * feat: use cached space code to join space on create account (#4224) * chore: hide course filters in onboarding pages (#4226) * feat: show warning popup on l2/activity language mixup (#4229) * chore: add some debugging statement for staging logout issue (#4234) * fix: on SSO registration, pass langcode to onboarding pages (#4235) * fix: refresh expired course cache (#4240) * Adjust unread badge height to compensate for activity header height (#4213) * Adjust unread badge height to compensate for activity header height * Limit height instead of hardcoding values * Hide course analytics download button on mobile (#4241) * 4242 change course redirect (#4245) * feat: connect with synapse public courses endpoint * intergate course IDs into response model * remove course redirect, update user's l2 on return to language selection page * display on public courses page to go to page to make your own and display on make your on page to skip to rooms * fix: hide activity finished status message for archived activities (#4246) * fix: fix join with code redirect for non-spaces (#4248) * 4172 color inconsistency of activity elements (#4247) * activity menu color consistency And some sizing changes, made the stats button box much smaller * revert activity button size changes Also make text bigger to fill box, and make menu/summary buttons solid colors so the shadow under the button works. * feat: allow users to give token feedback in word card * feat: set initial L2 via cached space code course target language if available (#4264) * fix: fix onboarding redirect on login (#4265) * Updating logo with Vector svg Image (#4263) * Updated Logo with SVG image & adjusted margins to keep things center * Un-formated the Index.html * Remove invite option from participants widget in DM (#4256) * chore: padding adjustment in selected course view (#4267) * chore: on invite, also invite to course parent (#4268) * fix: don't show language mismatch warning popup if activity lang matches L1 (#4269) * fix: don't update profile until user controller initialized, redirect to rooms from SSO login, in create account page redirect to language selection page if no language available (#4274) * feat: add selected course page for public courses, redirect there on click public course, filter out already-joined public courses (#4276) * chore: remove l1 and CERF course filters from start course and public courses pages, update styling of l2 dropdown (#4278) * integrate original course topic activity field (#4295) * fix: fix start your own course link in public courses page (#4306) * change seed to new vocab bubble (#4305) * change seed to new vocab bubble and tweak the animation to fade in, then rise/fade out since this looks better than spinning in. * formatting --------- Co-authored-by: ggurdin <ggurdin@gmail.com> * Make users return to activity session when use invite back button (#4288) * feat: add notification volume setting (#4310) * chore: enable activity stats button if someone else finishes the activity (#4311) * chore: on play with bot timeout, show warning popup (#4312) * chore: show activity stats cutout tooltip on other user finish activity (#4316) * 4307 bot in dms and activity chats only (#4319) * remove bot settings files * exclude bot in invite page * listen to language / CERF level changes and update bot DM settings * Update lib/pangea/common/controllers/pangea_controller.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: don't assume that list of IDs to fetch and list of fetched objects are the same length (#4322) * chore: remove background color from activity goal tooltip (#4324) * fix: prevent word card title from bouncing around (#4325) * fix: on join activity with role, preload activity participants list to get accurate list of assigned roles (#4326) * chore: give max width to activity participant indicator widgets (#4327) * fix: add value key based on selected tab to course settings widget to force refresh on navigate from finished activity (#4331) * fix: prevent overflows in token info feedback dialog on mobile, add more specific unsubscribed error in future loading dialog (#4333) * fix: fix storage of selected language not working on mobile (#4334) * chore: reduce padding around message in new trip page (#4335) * chore: more specific error message on not found course with code (#4336) * chore: dismiss last snackbar before show invite snackbar (#4337) * chore: switch order of buttons in space delete dialog (#4338) * chore: add custom map icons (#4339) * chore: add create at and updated at fields to course plan model (#4340) * chore: add leave space description (#4341) * refactor: remove ability to directly edit lemma defintions and morph assignments (#4347) * Organize course repos (#4262) * integrate CoursePlansRepo.translateActivity, translateTopic, translateCoursePlan * move translation functions to requisite files * integrate translation endpoint * refactor: reorganize course-related repos, add request and response model classes * remove l2s from translation requests * update translation request and response models, use translation endpoint to get course info, cache courses with L1s in cache key * update topics repo to use translation endpoint * use activity translation endpoint * refactor: incremental loading of individual course info, account for discrepancy between translated IDs and original IDs * incremental loading of course batches * Update lib/pangea/course_plans/courses/course_plan_room_extension.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * cleanup * cleanup * fix: some name changes * formatting --------- Co-authored-by: WilsonLe <leanhminh2907@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: wcjord <32568597+wcjord@users.noreply.github.com> * fix: use same context in show and hide token feedback snackbar to fix closing functionality (#4349) * fix: filter courses only by short lang code (#4350) * fix: filter courses only by short lang code * Update lib/pangea/course_creation/course_search_provider.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update lib/pangea/login/pages/public_trip_page.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: always call setState on update target language filter --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add select all button to the delete space dialog (#4353) * Initial plan * Add select all button to delete space dialog Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * Style select all button as CheckboxListTile Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * update copy --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> Co-authored-by: ggurdin <ggurdin@gmail.com> * 4354 room stuck indefinitely loading (#4357) * fix: stop loading course if course plan provider if courseId is null * don't allow padding of null string to loadCoursePlan * fix: reload space course after updating course state event, wait for … (#4359) * fix: reload space course after updating course state event, wait for course ID update in sync after returning from add course to space function * Update lib/pangea/course_settings/course_settings.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: filter out public courses for which course ID failed to load (#4360) * 3976 making emoji selection more of an activity (#4255) * add shimmer in vocab page when no emoji selected * fix shimmer in 2 column mode and add XP for first emoji selection * add xp sparkle on emoji selection * formatting, imports, widget name typo fix * dont rebuild analytics page on every analytics stream update * remove listener * move animation and selection visual after slow function for better visual flow and hopefully not noticeable stutter * change transformTargetId into variable, update local display state before awaiting saving to analytics room --------- Co-authored-by: ggurdin <ggurdin@gmail.com> * Hide vocab analytics instructions when filtering or searching (#4362) * Initial plan * Hide instructions tooltip when searching or filtering vocabulary Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * Hide activity end prompt text when activity is archived (#4364) * Initial plan * Hide activity end prompt when activity is archived Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * fix: stop rebuilding whole course settings tab on screen size change (#4368) * Fix foreground notification navigation to activity sessions for course pings (#4369) * Initial plan * Fix foreground notification navigation to activity sessions Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * Add clarifying comments to notification handling code Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * Refactor to reduce duplicate code between _onOpenNotification and goToRoom Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * chore: fix foreground notif small icon --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> Co-authored-by: ggurdin <ggurdin@gmail.com> * fix: show screen loading in course settings until activity roles are … (#4374) * fix: show screen loading in course settings until activity roles are completly loaded * show loading indicator over activity card on load course summary * Update lib/pages/chat_details/chat_details.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: on load course topics, also load location media to get topic images (#4376) * Add "Share course" tooltip to ShareRoomButton (#4375) * Initial plan * Add 'Share course' tooltip to ShareRoomButton Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * Move shareCourse localization to end of intl_en.arb Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * Remove L1 (base language) display from course info chips (#4378) * Initial plan * Remove L1 display from courses Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * chore: only show unlocalized language options in course search target language dropdowns (#4380) * fix: after add course to existing space, push redirect route to refresh page (#4381) * fix: update isActivityStarted to rely on assignedRoles instead of directly using state event (#4382) * add XP animation on match activity tokens (#4373) * 4379 show participants in public courses selection (#4383) * chore: trip body / icons updates * chore: display participant count in public courses page, update trip-related copy * fix: add base language dropdown to language selection page on identic… (#4384) * fix: add base language dropdown to language selection page on identical target and system language * Update lib/pangea/login/utils/lang_code_repo.dart Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: add cms api url to activity image paths to load properly (#4385) * fix: don't mutate activity JSON image_url (#4386) * Update onboarding language selection text to "Choose a target language" (#4393) * Initial plan * Update chooseLanguage text to "Choose a target language" Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * Update IT help message and remove unreferenced InstructionsEnum entries (#4391) * Initial plan * Update IT help message and remove unreferenced enum entries Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * Revert changes to non-English .arb files Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * remove unreferenced copy --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> Co-authored-by: ggurdin <ggurdin@gmail.com> * fix: alway hide back button in add course page (#4404) * Move word card feedback notification from bottom to top of screen (#4402) * Initial plan * Replace bottom SnackBar with top overlay notification for word card feedback Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> * auto-close top token feedback snackbar after delay --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ggurdin <46800240+ggurdin@users.noreply.github.com> Co-authored-by: ggurdin <ggurdin@gmail.com> * chore: add level bar / analytics to space details page on mobiel (#4405) * chore: add skip button to add course page (#4407) * chore: message on empty vocab filter (#4410) * chore: add tooltip to describe vocab highlighting in activity dropdown menu (#4412) * fix: don't delete archived activities on delete space (#4414) * fix: don't delete archived activities on delete space * use one list of futures in delete space function * fix: refresh chat list on join with link (#4417) * chore: make word card close and flag button the same styling and vertically aligned (#4419) * fix: if a new user gets to account create page without target language in local storage or from course, direct them back to language selection (#4422) * fix: handle room code on join with code (#4427) * fix: push route on start to make add course page app bar back button work as expected (#4430) * chore: update translations (#4188) * translate more l1s * Update translations for multiple languages (ar, bn, he, hi, id, ko, pt, ru, th, tr, zh) * partial translations * Add translations for Irish, Galician, Hungarian, Lithuanian, Slovenian, and Telugu - Complete translations for 6 additional languages using OpenAI translation script - Irish (ga): 1,612 translations added - Galician (gl): 1,614 translations added - Hungarian (hu): 1,615 translations added - Lithuanian (lt): 1,927 translations added - Slovenian (sl): 2,288 translations added - Telugu (te): 2,388 translations added These additions bring the total completed languages to 29 out of 47 (62% completion rate) * Add translations for Estonian, Belarusian, and Greek - Estonian (et): 164 translations added - Belarusian (be): 2,392 translations added - Greek (el): 2,342 translations added These additions bring the total completed languages to 32 out of 47 (68% completion rate) * Add Hebrew translations - Hebrew (he): 2,143 translations added - This brings the total completed languages to 33 out of 47 (70 percent completion rate) * Add Arabic and Bengali translations - Arabic (ar): 1,692 translations added - Bengali (bn): 2,388 translations added - Total: 35 out of 47 languages complete (74 percent completion rate) * Add Interlingua and Interlingue translations - Interlingua (ia): 2,378 translations added - Interlingue (ie): 2,149 translations added - Total: 37 out of 47 languages complete (79 percent completion rate) * Add Georgian translations * Add Esperanto translations * Add Turkish translations * Add Persian translations * Add Romanian translations * Improve translation script error handling - Add JSON parsing error handling with retry logic - Use simpler prompts on retry attempts - Clean up markdown formatting from responses - Skip failed chunks gracefully instead of crashing - Successfully handle previously failing languages * Update Georgian and add Romanian translations * Add Serbian, Latvian, Slovak, Tamil and Basque translations Successfully completed: - Serbian (sr): 2062 translations - Latvian (lv): 1614 translations - Slovak (sk): 2158 translations - Tamil (ta): 1696 translations - Basque (eu): 1615 translations Script improvements: - Added metadata reconciliation error handling - Successfully handles JSON parsing errors with retry logic * fix needed translation generation script * feat: translate missing keys for 49 languages and improve translation script - Successfully translated 12,000+ keys across 49 languages (98% completion) - Enhanced JSON error handling in translate script to recover from parsing errors - Fixed metadata type issues for unreadChats placeholder in fil, pt_PT, and yue locales - Added comprehensive run_all_translations.py script for batch translation - Resolved duplicate yue locale conflicts - Only Tibetan (bo) remains with 40 keys due to complex character encoding issues Languages completed: - Vietnamese, Portuguese (BR/PT), Romanian, Russian, Slovak, Slovenian - Serbian, Swedish, Tamil, Telugu, Thai, Turkish, Ukrainian, Cantonese - Chinese (Simplified/Traditional), and 34 other languages with 17 keys each * fix not compilling error * catch up with needed translations * chore: on no courses found for language, log error (#4434) * fix: fix scrolling in delete space dialog (#4436) * build: bump version number * chore: remove vocab tooltip from activity dropdown menu and update copy in end activity button (#4445) * removed old code (#4446) * change xp icon to star (#4431) * fix: on login, don't open two separate databases (#4449) * fix: register UIA listener on create login client, instead of on login (#4451) * fix: on click space nav item use context.push to refresh course settings page (#4462) * chore: add activity roles to activity summary request model (#4479) * build: bump version number --------- Co-authored-by: Kelrap <99418823+Kelrap@users.noreply.github.com> Co-authored-by: Wilson <leanhminh2907@gmail.com> Co-authored-by: avashilling <165050625+avashilling@users.noreply.github.com> Co-authored-by: Brord van Wierst <brordvwierst@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: wcjord <32568597+wcjord@users.noreply.github.com> Co-authored-by: Alexa "Tig" Harriss <alexa.harriss@gmail.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1301 lines
47 KiB
Dart
1301 lines
47 KiB
Dart
import 'dart:async';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:matrix/matrix_api_lite/generated/model.dart';
|
|
|
|
import 'package:fluffychat/config/app_config.dart';
|
|
import 'package:fluffychat/config/themes.dart';
|
|
import 'package:fluffychat/pages/archive/archive.dart';
|
|
import 'package:fluffychat/pages/chat/chat.dart';
|
|
import 'package:fluffychat/pages/chat_access_settings/chat_access_settings_controller.dart';
|
|
import 'package:fluffychat/pages/chat_details/chat_details.dart';
|
|
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
|
import 'package:fluffychat/pages/chat_members/chat_members.dart';
|
|
import 'package:fluffychat/pages/chat_permissions_settings/chat_permissions_settings.dart';
|
|
import 'package:fluffychat/pages/chat_search/chat_search_page.dart';
|
|
import 'package:fluffychat/pages/device_settings/device_settings.dart';
|
|
import 'package:fluffychat/pages/login/login.dart';
|
|
import 'package:fluffychat/pages/new_group/new_group.dart';
|
|
import 'package:fluffychat/pages/new_private_chat/new_private_chat.dart';
|
|
import 'package:fluffychat/pages/settings/settings.dart';
|
|
import 'package:fluffychat/pages/settings_3pid/settings_3pid.dart';
|
|
import 'package:fluffychat/pages/settings_chat/settings_chat.dart';
|
|
import 'package:fluffychat/pages/settings_emotes/settings_emotes.dart';
|
|
import 'package:fluffychat/pages/settings_homeserver/settings_homeserver.dart';
|
|
import 'package:fluffychat/pages/settings_ignore_list/settings_ignore_list.dart';
|
|
import 'package:fluffychat/pages/settings_multiple_emotes/settings_multiple_emotes.dart';
|
|
import 'package:fluffychat/pages/settings_notifications/settings_notifications.dart';
|
|
import 'package:fluffychat/pages/settings_password/settings_password.dart';
|
|
import 'package:fluffychat/pages/settings_security/settings_security.dart';
|
|
import 'package:fluffychat/pages/settings_style/settings_style.dart';
|
|
import 'package:fluffychat/pangea/activity_sessions/activity_session_start/activity_session_start_page.dart';
|
|
import 'package:fluffychat/pangea/analytics_misc/construct_type_enum.dart';
|
|
import 'package:fluffychat/pangea/analytics_page/analytics_page.dart';
|
|
import 'package:fluffychat/pangea/analytics_summary/progress_indicators_enum.dart';
|
|
import 'package:fluffychat/pangea/chat_settings/pages/edit_course.dart';
|
|
import 'package:fluffychat/pangea/chat_settings/pages/pangea_invitation_selection.dart';
|
|
import 'package:fluffychat/pangea/constructs/construct_identifier.dart';
|
|
import 'package:fluffychat/pangea/course_creation/course_invite_page.dart';
|
|
import 'package:fluffychat/pangea/course_creation/selected_course_page.dart';
|
|
import 'package:fluffychat/pangea/extensions/pangea_room_extension.dart';
|
|
import 'package:fluffychat/pangea/find_your_people/find_your_people_constants.dart';
|
|
import 'package:fluffychat/pangea/guard/p_vguard.dart';
|
|
import 'package:fluffychat/pangea/learning_settings/pages/settings_learning.dart';
|
|
import 'package:fluffychat/pangea/login/pages/add_course_page.dart';
|
|
import 'package:fluffychat/pangea/login/pages/course_code_page.dart';
|
|
import 'package:fluffychat/pangea/login/pages/create_pangea_account_page.dart';
|
|
import 'package:fluffychat/pangea/login/pages/language_selection_page.dart';
|
|
import 'package:fluffychat/pangea/login/pages/login_or_signup_view.dart';
|
|
import 'package:fluffychat/pangea/login/pages/new_course_page.dart';
|
|
import 'package:fluffychat/pangea/login/pages/public_courses_page.dart';
|
|
import 'package:fluffychat/pangea/login/pages/signup.dart';
|
|
import 'package:fluffychat/pangea/space_analytics/space_analytics.dart';
|
|
import 'package:fluffychat/pangea/spaces/constants/space_constants.dart';
|
|
import 'package:fluffychat/pangea/spaces/utils/join_with_link.dart';
|
|
import 'package:fluffychat/pangea/subscription/pages/settings_subscription.dart';
|
|
import 'package:fluffychat/widgets/config_viewer.dart';
|
|
import 'package:fluffychat/widgets/layouts/empty_page.dart';
|
|
import 'package:fluffychat/widgets/layouts/two_column_layout.dart';
|
|
import 'package:fluffychat/widgets/log_view.dart';
|
|
import 'package:fluffychat/widgets/matrix.dart';
|
|
import 'package:fluffychat/widgets/share_scaffold_dialog.dart';
|
|
|
|
abstract class AppRoutes {
|
|
static FutureOr<String?> loggedInRedirect(
|
|
BuildContext context,
|
|
GoRouterState state,
|
|
) {
|
|
// #Pangea
|
|
// Matrix.of(context).widget.clients.any((client) => client.isLogged())
|
|
// ? '/rooms'
|
|
// : null;
|
|
return PAuthGaurd.homeRedirect(context, state);
|
|
// Pangea#
|
|
}
|
|
|
|
static FutureOr<String?> loggedOutRedirect(
|
|
BuildContext context,
|
|
GoRouterState state,
|
|
) {
|
|
// #Pangea
|
|
// Matrix.of(context).widget.clients.any((client) => client.isLogged())
|
|
// ? null
|
|
// : '/home';
|
|
return PAuthGaurd.roomsRedirect(context, state);
|
|
// Pangea#
|
|
}
|
|
|
|
AppRoutes();
|
|
|
|
static final List<RouteBase> routes = [
|
|
GoRoute(
|
|
path: '/',
|
|
redirect: (context, state) =>
|
|
Matrix.of(context).widget.clients.any((client) => client.isLogged())
|
|
? '/rooms'
|
|
: '/home',
|
|
),
|
|
GoRoute(
|
|
path: '/home',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
// #Pangea
|
|
// const HomeserverPicker(addMultiAccount: false),
|
|
const LoginOrSignupView(),
|
|
// Pangea#
|
|
),
|
|
redirect: loggedInRedirect,
|
|
routes: [
|
|
GoRoute(
|
|
path: 'login',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
// #Pangea
|
|
// Login(client: state.extra as Client),
|
|
const Login(),
|
|
// Pangea#
|
|
),
|
|
redirect: loggedInRedirect,
|
|
// #Pangea
|
|
routes: [
|
|
GoRoute(
|
|
path: 'email',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const Login(withEmail: true),
|
|
),
|
|
),
|
|
],
|
|
// Pangea#
|
|
),
|
|
// #Pangea
|
|
GoRoute(
|
|
path: 'language',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const LanguageSelectionPage(),
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: 'signup',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const SignupPage(),
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: 'email',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const SignupPage(
|
|
withEmail: true,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
// Pangea#
|
|
],
|
|
),
|
|
GoRoute(
|
|
path: '/logs',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const LogViewer(),
|
|
),
|
|
),
|
|
GoRoute(
|
|
path: '/configs',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const ConfigViewer(),
|
|
),
|
|
),
|
|
// #Pangea
|
|
GoRoute(
|
|
path: '/registration',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const LanguageSelectionPage(),
|
|
),
|
|
redirect: PAuthGaurd.onboardingRedirect,
|
|
routes: [
|
|
GoRoute(
|
|
path: 'create',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const CreatePangeaAccountPage(),
|
|
),
|
|
),
|
|
GoRoute(
|
|
path: 'course',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const AddCoursePage(route: 'registration'),
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: 'private',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const CourseCodePage(),
|
|
);
|
|
},
|
|
),
|
|
GoRoute(
|
|
path: 'public',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const PublicCoursesPage(
|
|
route: 'registration',
|
|
showFilters: false,
|
|
),
|
|
);
|
|
},
|
|
routes: [
|
|
GoRoute(
|
|
path: ':courseid',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
SelectedCourse(
|
|
state.pathParameters['courseid']!,
|
|
SelectedCourseMode.join,
|
|
roomChunk: state.extra as PublicRoomsChunk?,
|
|
),
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
GoRoute(
|
|
path: 'own',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const NewCoursePage(
|
|
route: 'registration',
|
|
showFilters: false,
|
|
),
|
|
);
|
|
},
|
|
routes: [
|
|
GoRoute(
|
|
path: ':courseid',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
SelectedCourse(
|
|
state.pathParameters['courseid']!,
|
|
SelectedCourseMode.launch,
|
|
),
|
|
);
|
|
},
|
|
routes: [
|
|
GoRoute(
|
|
path: 'invite',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
CourseInvitePage(
|
|
state.pathParameters['courseid']!,
|
|
courseCreationCompleter:
|
|
state.extra as Completer<String>?,
|
|
),
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
GoRoute(
|
|
path: '/join_with_link',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
JoinClassWithLink(
|
|
classCode: state.uri.queryParameters[SpaceConstants.classCode],
|
|
),
|
|
),
|
|
),
|
|
// Pangea#
|
|
ShellRoute(
|
|
// Never use a transition on the shell route. Changing the PageBuilder
|
|
// here based on a MediaQuery causes the child to briefly be rendered
|
|
// twice with the same GlobalKey, blowing up the rendering.
|
|
pageBuilder: (context, state, child) => noTransitionPageBuilder(
|
|
context,
|
|
state,
|
|
// #Pangea
|
|
// FluffyThemes.isColumnMode(context) &&
|
|
// state.fullPath?.startsWith('/rooms/settings') == false
|
|
// ? TwoColumnLayout(
|
|
// mainView: ChatList(
|
|
// activeChat: state.pathParameters['roomid'],
|
|
// displayNavigationRail:
|
|
// state.path?.startsWith('/rooms/settings') != true,
|
|
// ),
|
|
// sideView: child,
|
|
// )
|
|
// : child,
|
|
TwoColumnLayout(
|
|
state: state,
|
|
sideView: child,
|
|
),
|
|
// Pangea#
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: '/rooms',
|
|
redirect: loggedOutRedirect,
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
FluffyThemes.isColumnMode(context)
|
|
// #Pangea
|
|
// ? const EmptyPage()
|
|
? Center(
|
|
child: CachedNetworkImage(
|
|
width: 250.0,
|
|
imageUrl:
|
|
"${AppConfig.assetsBaseURL}/${FindYourPeopleConstants.sideBearFileName}",
|
|
),
|
|
)
|
|
// Pangea#
|
|
: ChatList(
|
|
activeChat: state.pathParameters['roomid'],
|
|
activeSpaceId: state.pathParameters['spaceid'],
|
|
),
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: 'archive',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const Archive(),
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: ':roomid',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ChatPage(
|
|
roomId: state.pathParameters['roomid']!,
|
|
eventId: state.uri.queryParameters['event'],
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
],
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'newprivatechat',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const NewPrivateChat(),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'newgroup',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
// #Pangea
|
|
// const NewGroup(),
|
|
NewGroup(spaceId: state.uri.queryParameters['space']),
|
|
// Pangea#
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'newspace',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const NewGroup(createGroupType: CreateGroupType.space),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
// #Pangea
|
|
// ShellRoute(
|
|
// pageBuilder: (context, state, child) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// FluffyThemes.isColumnMode(context)
|
|
// ? TwoColumnLayout(
|
|
// mainView: PangeaSideView(path: state.fullPath),
|
|
// sideView: child,
|
|
// )
|
|
// : child,
|
|
// ),
|
|
// routes: [
|
|
GoRoute(
|
|
path: 'course',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const AddCoursePage(route: 'rooms'),
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: 'private',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const CourseCodePage(),
|
|
);
|
|
},
|
|
),
|
|
GoRoute(
|
|
path: 'public',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const PublicCoursesPage(
|
|
route: 'rooms',
|
|
),
|
|
);
|
|
},
|
|
routes: [
|
|
GoRoute(
|
|
path: ':courseid',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
SelectedCourse(
|
|
state.pathParameters['courseid']!,
|
|
SelectedCourseMode.join,
|
|
roomChunk: state.extra as PublicRoomsChunk?,
|
|
),
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
GoRoute(
|
|
path: 'own',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const NewCoursePage(route: 'rooms'),
|
|
);
|
|
},
|
|
routes: [
|
|
GoRoute(
|
|
path: ':courseid',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
SelectedCourse(
|
|
state.pathParameters['courseid']!,
|
|
SelectedCourseMode.launch,
|
|
),
|
|
);
|
|
},
|
|
routes: [
|
|
GoRoute(
|
|
path: 'invite',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
CourseInvitePage(
|
|
state.pathParameters['courseid']!,
|
|
courseCreationCompleter:
|
|
state.extra as Completer<String>?,
|
|
),
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
GoRoute(
|
|
path: 'analytics',
|
|
redirect: loggedOutRedirect,
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
AnalyticsPage(
|
|
indicator: FluffyThemes.isColumnMode(context)
|
|
? null
|
|
: ProgressIndicatorEnum.wordsUsed,
|
|
),
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: ConstructTypeEnum.morph.string,
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
AnalyticsPage(
|
|
indicator: FluffyThemes.isColumnMode(context)
|
|
? null
|
|
: ProgressIndicatorEnum.morphsUsed,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
routes: [
|
|
GoRoute(
|
|
path: ':construct',
|
|
pageBuilder: (context, state) {
|
|
final construct = ConstructIdentifier.fromString(
|
|
state.pathParameters['construct']!,
|
|
);
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
AnalyticsPage(
|
|
indicator: ProgressIndicatorEnum.morphsUsed,
|
|
construct: construct,
|
|
),
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
GoRoute(
|
|
path: ConstructTypeEnum.vocab.string,
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
AnalyticsPage(
|
|
indicator: FluffyThemes.isColumnMode(context)
|
|
? null
|
|
: ProgressIndicatorEnum.wordsUsed,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
routes: [
|
|
GoRoute(
|
|
path: ':construct',
|
|
pageBuilder: (context, state) {
|
|
final construct = ConstructIdentifier.fromString(
|
|
state.pathParameters['construct']!,
|
|
);
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
AnalyticsPage(
|
|
indicator: ProgressIndicatorEnum.wordsUsed,
|
|
construct: construct,
|
|
),
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
GoRoute(
|
|
path: 'activities',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
AnalyticsPage(
|
|
indicator: FluffyThemes.isColumnMode(context)
|
|
? null
|
|
: ProgressIndicatorEnum.activities,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
routes: [
|
|
GoRoute(
|
|
path: ':roomid',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ChatPage(
|
|
roomId: state.pathParameters['roomid']!,
|
|
eventId: state.uri.queryParameters['event'],
|
|
backButton: BackButton(
|
|
onPressed: () => context.go(
|
|
"/rooms/analytics/activities",
|
|
),
|
|
),
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
],
|
|
),
|
|
GoRoute(
|
|
path: 'level',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
AnalyticsPage(
|
|
indicator: FluffyThemes.isColumnMode(context)
|
|
? null
|
|
: ProgressIndicatorEnum.level,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
],
|
|
),
|
|
// Pangea#
|
|
// #Pangea
|
|
// ShellRoute(
|
|
// pageBuilder: (context, state, child) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// FluffyThemes.isColumnMode(context)
|
|
// ? TwoColumnLayout(
|
|
// mainView: Settings(key: state.pageKey),
|
|
// sideView: child,
|
|
// )
|
|
// : child,
|
|
// ),
|
|
// routes: [
|
|
// Pangea#
|
|
GoRoute(
|
|
path: 'settings',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
FluffyThemes.isColumnMode(context)
|
|
? const EmptyPage()
|
|
: const Settings(),
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: 'notifications',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const SettingsNotifications(),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'style',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const SettingsStyle(),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'devices',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const DevicesSettings(),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'chat',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const SettingsChat(),
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: 'emotes',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const EmotesSettings(),
|
|
),
|
|
),
|
|
],
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
// #Pangea
|
|
// GoRoute(
|
|
// path: 'addaccount',
|
|
// redirect: loggedOutRedirect,
|
|
// pageBuilder: (context, state) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// const HomeserverPicker(addMultiAccount: true),
|
|
// ),
|
|
// routes: [
|
|
// GoRoute(
|
|
// path: 'login',
|
|
// pageBuilder: (context, state) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// Login(client: state.extra as Client),
|
|
// ),
|
|
// redirect: loggedOutRedirect,
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// Pangea#
|
|
GoRoute(
|
|
path: 'homeserver',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const SettingsHomeserver(),
|
|
);
|
|
},
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'security',
|
|
redirect: loggedOutRedirect,
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const SettingsSecurity(),
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: 'password',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const SettingsPassword(),
|
|
);
|
|
},
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'ignorelist',
|
|
pageBuilder: (context, state) {
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
SettingsIgnoreList(
|
|
initialUserId: state.extra?.toString(),
|
|
),
|
|
);
|
|
},
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: '3pid',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const Settings3Pid(),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
],
|
|
),
|
|
// #Pangea
|
|
GoRoute(
|
|
path: 'learning',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const SettingsLearning(
|
|
isDialog: false,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'subscription',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const SubscriptionManagement(),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
// Pangea#
|
|
],
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
// #Pangea
|
|
GoRoute(
|
|
path: 'spaces',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const EmptyPage(),
|
|
),
|
|
redirect: (context, state) {
|
|
if (state.pathParameters['spaceid'] == null) {
|
|
return "/rooms";
|
|
}
|
|
return loggedOutRedirect(context, state);
|
|
},
|
|
routes: [
|
|
GoRoute(
|
|
path: ':spaceid',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ChatDetails(
|
|
roomId: state.pathParameters['spaceid']!,
|
|
activeTab: state.uri.queryParameters['tab'],
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
routes: [
|
|
GoRoute(
|
|
path: 'details',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const EmptyPage(),
|
|
),
|
|
redirect: (context, state) {
|
|
String subroute =
|
|
state.fullPath?.split(":spaceid/details").last ??
|
|
"";
|
|
|
|
if (state.uri.queryParameters.isNotEmpty) {
|
|
final queryString = state.uri.queryParameters.entries
|
|
.map((e) => '${e.key}=${e.value}')
|
|
.join('&');
|
|
subroute = '$subroute?$queryString';
|
|
}
|
|
return "/rooms/spaces/${state.pathParameters['spaceid']}$subroute";
|
|
},
|
|
routes: roomDetailsRoutes('spaceid'),
|
|
),
|
|
...roomDetailsRoutes('spaceid'),
|
|
GoRoute(
|
|
path: 'addcourse',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
NewCoursePage(
|
|
route: 'rooms',
|
|
spaceId: state.pathParameters['spaceid']!,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
routes: [
|
|
GoRoute(
|
|
path: ':courseId',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
SelectedCourse(
|
|
state.pathParameters['courseId']!,
|
|
SelectedCourseMode.addToSpace,
|
|
spaceId: state.pathParameters['spaceid']!,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
],
|
|
),
|
|
GoRoute(
|
|
path: 'activity/:activityid',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ActivitySessionStartPage(
|
|
activityId: state.pathParameters['activityid']!,
|
|
roomId: state.uri.queryParameters['roomid'],
|
|
parentId: state.pathParameters['spaceid']!,
|
|
launch: state.uri.queryParameters['launch'] == 'true',
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: ':roomid',
|
|
pageBuilder: (context, state) {
|
|
final body = state.uri.queryParameters['body'];
|
|
var shareItems = state.extra is List<ShareItem>
|
|
? state.extra as List<ShareItem>
|
|
: null;
|
|
if (body != null && body.isNotEmpty) {
|
|
shareItems ??= [];
|
|
shareItems.add(TextShareItem(body));
|
|
}
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ChatPage(
|
|
roomId: state.pathParameters['roomid']!,
|
|
shareItems: shareItems,
|
|
eventId: state.uri.queryParameters['event'],
|
|
),
|
|
);
|
|
},
|
|
redirect: loggedOutRedirect,
|
|
routes: [
|
|
GoRoute(
|
|
path: 'search',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ChatSearchPage(
|
|
roomId: state.pathParameters['roomid']!,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'invite',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
PangeaInvitationSelection(
|
|
roomId: state.pathParameters['roomid']!,
|
|
initialFilter:
|
|
state.uri.queryParameters['filter'] != null
|
|
? InvitationFilter.fromString(
|
|
state.uri.queryParameters['filter']!,
|
|
)
|
|
: null,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'details',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ChatDetails(
|
|
roomId: state.pathParameters['roomid']!,
|
|
),
|
|
),
|
|
routes: roomDetailsRoutes('roomid'),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
// Pangea#
|
|
GoRoute(
|
|
path: ':roomid',
|
|
pageBuilder: (context, state) {
|
|
final body = state.uri.queryParameters['body'];
|
|
var shareItems = state.extra is List<ShareItem>
|
|
? state.extra as List<ShareItem>
|
|
: null;
|
|
if (body != null && body.isNotEmpty) {
|
|
shareItems ??= [];
|
|
shareItems.add(TextShareItem(body));
|
|
}
|
|
return defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ChatPage(
|
|
roomId: state.pathParameters['roomid']!,
|
|
shareItems: shareItems,
|
|
eventId: state.uri.queryParameters['event'],
|
|
),
|
|
);
|
|
},
|
|
// #Pangea
|
|
// redirect: loggedOutRedirect,
|
|
redirect: (context, state) {
|
|
String subroute = state.fullPath!.split('roomid').last;
|
|
if (state.uri.queryParameters.isNotEmpty) {
|
|
final queryString = state.uri.queryParameters.entries
|
|
.map((e) => '${e.key}=${e.value}')
|
|
.join('&');
|
|
subroute = '$subroute?$queryString';
|
|
}
|
|
|
|
final roomId = state.pathParameters['roomid']!;
|
|
final room = Matrix.of(context).client.getRoomById(roomId);
|
|
if (room != null && room.isSpace) {
|
|
return "/rooms/spaces/${room.id}$subroute";
|
|
}
|
|
|
|
final parent = room?.firstSpaceParent;
|
|
if (parent != null && state.fullPath != null) {
|
|
return "/rooms/spaces/${parent.id}/$roomId$subroute";
|
|
}
|
|
return loggedOutRedirect(context, state);
|
|
},
|
|
// Pangea#
|
|
routes: [
|
|
GoRoute(
|
|
path: 'search',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ChatSearchPage(
|
|
roomId: state.pathParameters['roomid']!,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
// #Pangea
|
|
// GoRoute(
|
|
// path: 'encryption',
|
|
// pageBuilder: (context, state) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// const ChatEncryptionSettings(),
|
|
// ),
|
|
// redirect: loggedOutRedirect,
|
|
// ),
|
|
// Pangea#
|
|
GoRoute(
|
|
path: 'invite',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
PangeaInvitationSelection(
|
|
roomId: state.pathParameters['roomid']!,
|
|
initialFilter: state.uri.queryParameters['filter'] != null
|
|
? InvitationFilter.fromString(
|
|
state.uri.queryParameters['filter']!,
|
|
)
|
|
: null,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'details',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ChatDetails(
|
|
roomId: state.pathParameters['roomid']!,
|
|
),
|
|
),
|
|
// #Pangea
|
|
routes: roomDetailsRoutes('roomid'),
|
|
// routes: [
|
|
// GoRoute(
|
|
// path: 'access',
|
|
// pageBuilder: (context, state) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// ChatAccessSettings(
|
|
// roomId: state.pathParameters['roomid']!,
|
|
// ),
|
|
// ),
|
|
// redirect: loggedOutRedirect,
|
|
// ),
|
|
// GoRoute(
|
|
// path: 'members',
|
|
// pageBuilder: (context, state) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// ChatMembersPage(
|
|
// roomId: state.pathParameters['roomid']!,
|
|
// ),
|
|
// ),
|
|
// redirect: loggedOutRedirect,
|
|
// ),
|
|
// GoRoute(
|
|
// path: 'permissions',
|
|
// pageBuilder: (context, state) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// const ChatPermissionsSettings(),
|
|
// ),
|
|
// redirect: loggedOutRedirect,
|
|
// ),
|
|
// GoRoute(
|
|
// path: 'invite',
|
|
// pageBuilder: (context, state) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// PangeaInvitationSelection(
|
|
// roomId: state.pathParameters['roomid']!,
|
|
// initialFilter:
|
|
// state.uri.queryParameters['filter'] != null
|
|
// ? InvitationFilter.fromString(
|
|
// state.uri.queryParameters['filter']!,
|
|
// )
|
|
// : null,
|
|
// ),
|
|
// ),
|
|
// redirect: loggedOutRedirect,
|
|
// ),
|
|
// GoRoute(
|
|
// path: 'multiple_emotes',
|
|
// pageBuilder: (context, state) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// const MultipleEmotesSettings(),
|
|
// ),
|
|
// redirect: loggedOutRedirect,
|
|
// ),
|
|
// GoRoute(
|
|
// path: 'emotes',
|
|
// pageBuilder: (context, state) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// const EmotesSettings(),
|
|
// ),
|
|
// redirect: loggedOutRedirect,
|
|
// ),
|
|
// GoRoute(
|
|
// path: 'emotes/:state_key',
|
|
// pageBuilder: (context, state) => defaultPageBuilder(
|
|
// context,
|
|
// state,
|
|
// const EmotesSettings(),
|
|
// ),
|
|
// redirect: loggedOutRedirect,
|
|
// ),
|
|
// ],
|
|
// Pangea#
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
];
|
|
|
|
static Page noTransitionPageBuilder(
|
|
BuildContext context,
|
|
GoRouterState state,
|
|
Widget child,
|
|
) =>
|
|
NoTransitionPage(
|
|
key: state.pageKey,
|
|
restorationId: state.pageKey.value,
|
|
child: child,
|
|
);
|
|
|
|
static Page defaultPageBuilder(
|
|
BuildContext context,
|
|
GoRouterState state,
|
|
Widget child,
|
|
) =>
|
|
// #Pangea
|
|
noTransitionPageBuilder(context, state, child);
|
|
// FluffyThemes.isColumnMode(context)
|
|
// ? noTransitionPageBuilder(context, state, child)
|
|
// : MaterialPage(
|
|
// key: state.pageKey,
|
|
// restorationId: state.pageKey.value,
|
|
// child: child,
|
|
// );
|
|
// Pangea#
|
|
|
|
// #Pangea
|
|
static List<RouteBase> get newRoomRoutes => [
|
|
GoRoute(
|
|
path: 'newgroup',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const NewGroup(),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'newspace',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const NewGroup(createGroupType: CreateGroupType.space),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
];
|
|
|
|
static List<RouteBase> roomDetailsRoutes(String roomKey) => [
|
|
GoRoute(
|
|
path: '/edit',
|
|
redirect: loggedOutRedirect,
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
EditCourse(roomId: state.pathParameters[roomKey]!),
|
|
),
|
|
),
|
|
GoRoute(
|
|
path: '/analytics',
|
|
redirect: loggedOutRedirect,
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
SpaceAnalytics(
|
|
roomId: state.pathParameters[roomKey]!,
|
|
),
|
|
),
|
|
),
|
|
GoRoute(
|
|
path: 'access',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ChatAccessSettings(
|
|
roomId: state.pathParameters[roomKey]!,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'members',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
ChatMembersPage(
|
|
roomId: state.pathParameters[roomKey]!,
|
|
filter: state.uri.queryParameters['filter'],
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'permissions',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const ChatPermissionsSettings(),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'invite',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
PangeaInvitationSelection(
|
|
roomId: state.pathParameters[roomKey]!,
|
|
initialFilter: state.uri.queryParameters['filter'] != null
|
|
? InvitationFilter.fromString(
|
|
state.uri.queryParameters['filter']!,
|
|
)
|
|
: null,
|
|
),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'multiple_emotes',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const MultipleEmotesSettings(),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'emotes',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const EmotesSettings(),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
GoRoute(
|
|
path: 'emotes/:state_key',
|
|
pageBuilder: (context, state) => defaultPageBuilder(
|
|
context,
|
|
state,
|
|
const EmotesSettings(),
|
|
),
|
|
redirect: loggedOutRedirect,
|
|
),
|
|
];
|
|
// Pangea#
|
|
}
|