55// them and/or modify them under the terms of the MIT License;
66// see the LICENSE file for more details.
77
8- // Main entry point of the summarization feature in the Indico plugin.
9- // This file defines the Summarize button, manages modal states,
10- // handles prompt selection, generates summaries, and integrates
11- // with Indico's API to fetch and save meeting notes.
12-
138import staticURL from 'indico-url:plugin_ai_summary.static' ;
149import getStoredPrompts from 'indico-url:plugin_ai_summary.llm_prompts' ;
1510
1611import React , { useState , useEffect } from 'react' ;
1712import ReactDOM from 'react-dom' ;
18- import { Modal , Button , Form , Grid , GridRow , GridColumn , Header , Icon , Loader , Popup } from 'semantic-ui-react' ;
13+ import { Modal , Button , Form , Grid , GridRow , GridColumn , Header , Icon , Loader , Popup , Message } from 'semantic-ui-react' ;
1914import { Translate } from 'indico/react/i18n' ;
2015import { indicoAxios } from 'indico/utils/axios' ;
2116import { handleAxiosError } from 'indico/utils/axios' ;
@@ -36,6 +31,9 @@ function SummarizeButton({eventId, streamResponse, llmInfo}) {
3631 const [ isSaved , setIsSaved ] = useState ( false ) ;
3732 const [ streamStopped , setStreamStopped ] = useState ( false ) ;
3833 const [ streamCtl , setStreamCtl ] = useState ( null ) ;
34+ const [ isFeedbackDismissed , setIsFeedbackDismissed ] = useState (
35+ localStorage . getItem ( 'ai_summary_feedback_dismissed' ) === 'true' || false
36+ ) ;
3937
4038 // trigger summary generation from the backend
4139 const runSummarize = ( ) => {
@@ -201,6 +199,11 @@ function SummarizeButton({eventId, streamResponse, llmInfo}) {
201199 return null ;
202200 } ;
203201
202+ const handleFeedbackDismiss = ( ) => {
203+ setIsFeedbackDismissed ( true ) ;
204+ localStorage . setItem ( 'ai_summary_feedback_dismissed' , 'true' ) ;
205+ } ;
206+
204207 return (
205208 < >
206209 < Modal
@@ -232,28 +235,57 @@ function SummarizeButton({eventId, streamResponse, llmInfo}) {
232235 style = { { minWidth : '65vw' } }
233236 >
234237 < Modal . Header >
235- < Translate > Summarize Meeting</ Translate >
238+ < div styleName = "modal-header-section" >
239+ < Translate as = "span" > Summarize Meeting</ Translate >
240+ < Popup
241+ trigger = {
242+ < div styleName = "badge" >
243+ < Icon name = "flask" />
244+ < Translate as = "span" > Experimental</ Translate >
245+ </ div >
246+ }
247+ content = { Translate . string ( 'This is an experimental feature. Functionality may change or be withdrawn in future releases.' ) }
248+ position = "right center"
249+ />
250+ </ div >
236251 </ Modal . Header >
237252 < Modal . Content >
238253 < Grid celled = "internally" >
239254 < GridRow columns = { 2 } >
240- < GridColumn width = { 5 } >
241- < Form >
242- < Header as = "h3" content = { Translate . string ( 'Select a prompt' ) } />
243- < PromptControls
244- selectedPromptIndex = { selectedPromptIndex }
245- setSelectedPromptIndex = { setSelectedPromptIndex }
246- storedPrompts = { prompts }
247- disabled = { loading }
248- />
249- < PromptEditor
250- selectedPromptIndex = { selectedPromptIndex }
251- selectedPrompt = { selectedPrompt }
252- setPrompts = { setPrompts }
253- disabled = { loading }
254- />
255- { renderSummarizeButton ( loading , streamResponse , error ) }
256- </ Form >
255+ < GridColumn width = { 5 } style = { { display : 'flex' , flexDirection : 'column' } } >
256+ < div style = { { flex : 1 } } >
257+ < Form >
258+ < Header as = "h3" content = { Translate . string ( 'Select a prompt' ) } />
259+ < PromptControls
260+ selectedPromptIndex = { selectedPromptIndex }
261+ setSelectedPromptIndex = { setSelectedPromptIndex }
262+ storedPrompts = { prompts }
263+ disabled = { loading }
264+ />
265+ < PromptEditor
266+ selectedPromptIndex = { selectedPromptIndex }
267+ selectedPrompt = { selectedPrompt }
268+ setPrompts = { setPrompts }
269+ disabled = { loading }
270+ />
271+ { renderSummarizeButton ( loading , streamResponse , error ) }
272+ </ Form >
273+ </ div >
274+
275+ { ! isFeedbackDismissed && ! loading && summaryHtml && (
276+ < Message icon info style = { { marginTop : '10px' } } onDismiss = { handleFeedbackDismiss } >
277+ < Icon name = "comments outline" />
278+ < Message . Content >
279+ < Message . Header >
280+ < Translate > We want your feedback</ Translate >
281+ </ Message . Header >
282+ < Translate as = "p" > Share your feedback on this feature with us on our Mattermost channel</ Translate >
283+ < Button as = "a" href = "https://mattermost.web.cern.ch/it-dep/channels/indico" target = "_blank" primary >
284+ < Translate > Mattermost: Open #indico</ Translate >
285+ </ Button >
286+ </ Message . Content >
287+ </ Message >
288+ ) }
257289 </ GridColumn >
258290 < GridColumn width = { 11 } styleName = "column-divider" >
259291 < Header as = "h3" >
0 commit comments