diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index e5116ffa..c9fa8635 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -350,7 +350,7 @@ public function prepare(INotification $notification, string $languageCode): INot ->setParsedSubject($subject) ->setParsedMessage($message) // TODO: link directly to assignment - ->setLink($this->url->linkToRouteAbsolute(Application::APP_ID . '.assistant.getAssistantStandalonePage', ['sessionId' => $params['sessionId']])) + ->setLink($this->url->linkToRouteAbsolute(Application::APP_ID . '.assistant.getAssistantStandalonePage', ['sessionId' => $params['sessionId'], 'isAssignment' => 'true'])) ->setIcon($iconUrl); $actionLabel = $l->t('View assignment'); @@ -375,7 +375,7 @@ public function prepare(INotification $notification, string $languageCode): INot ->setParsedSubject($subject) ->setParsedMessage($message) // TODO: link directly to assignment - ->setLink($this->url->linkToRouteAbsolute(Application::APP_ID . '.assistant.getAssistantStandalonePage', ['sessionId' => $params['sessionId']])) + ->setLink($this->url->linkToRouteAbsolute(Application::APP_ID . '.assistant.getAssistantStandalonePage', ['sessionId' => $params['sessionId'], 'isAssignment' => 'true'])) ->setIcon($iconUrl); $actionLabel = $l->t('View assignment result'); @@ -400,7 +400,7 @@ public function prepare(INotification $notification, string $languageCode): INot ->setParsedSubject($subject) ->setParsedMessage($message) // TODO: link directly to assignment - ->setLink($this->url->linkToRouteAbsolute(Application::APP_ID . '.assistant.getAssistantStandalonePage', ['sessionId' => $params['sessionId']])) + ->setLink($this->url->linkToRouteAbsolute(Application::APP_ID . '.assistant.getAssistantStandalonePage', ['sessionId' => $params['sessionId'], 'isAssignment' => 'true'])) ->setIcon($iconUrl); $actionLabel = $l->t('View assignment result'); diff --git a/src/components/AssistantTextProcessingForm.vue b/src/components/AssistantTextProcessingForm.vue index 18ae18a8..c3006e8b 100644 --- a/src/components/AssistantTextProcessingForm.vue +++ b/src/components/AssistantTextProcessingForm.vue @@ -331,11 +331,15 @@ export default { 'background-notify', ], data() { + const urlIsAssignment = new URLSearchParams(window.location.search).get('isAssignment') + const urlSelectedTaskTypeId = urlIsAssignment != null && urlIsAssignment !== '0' && urlIsAssignment !== 'false' + ? 'assignments' + : null return { myInputs: this.inputs, myOutputs: this.outputs, taskTypes: [], - mySelectedTaskTypeId: this.selectedTaskTypeId || CHAT_TASK_TYPE_ID, + mySelectedTaskTypeId: urlSelectedTaskTypeId || this.selectedTaskTypeId || CHAT_TASK_TYPE_ID, loadingTaskTypes: false, historyLoading: false, showAdvanced: false, diff --git a/src/components/ChattyLLM/ChattyLLMInputForm.vue b/src/components/ChattyLLM/ChattyLLMInputForm.vue index d407e703..074fe849 100644 --- a/src/components/ChattyLLM/ChattyLLMInputForm.vue +++ b/src/components/ChattyLLM/ChattyLLMInputForm.vue @@ -481,8 +481,15 @@ export default { } }, - mounted() { - this.fetchSessions() + async mounted() { + await this.fetchSessions() + const urlSessionId = parseInt(new URLSearchParams(window.location.search).get('sessionId'), 10) + if (Number.isFinite(urlSessionId)) { + const session = this.sessions?.find(s => s.id === urlSessionId) + if (session) { + this.onSessionSelect(session) + } + } }, methods: {