Skip to content

Commit 1d7b4a9

Browse files
Add experimental feature notice
1 parent 41d5bd5 commit 1d7b4a9

File tree

2 files changed

+74
-24
lines changed

2 files changed

+74
-24
lines changed

ai_summary/indico_ai_summary/client/components/ind_summarize_button.jsx

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@
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-
138
import staticURL from 'indico-url:plugin_ai_summary.static';
149
import getStoredPrompts from 'indico-url:plugin_ai_summary.llm_prompts';
1510

1611
import React, {useState, useEffect} from 'react';
1712
import 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';
1914
import {Translate} from 'indico/react/i18n';
2015
import {indicoAxios} from 'indico/utils/axios';
2116
import {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">

ai_summary/indico_ai_summary/client/components/ind_summarize_button.module.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,24 @@
1414
border-left: 1px solid $raincloud-gray;
1515
}
1616

17+
.modal-header-section {
18+
display: flex;
19+
align-items: center;
20+
21+
.badge {
22+
margin-left: 10px;
23+
padding-top: 2px;
24+
padding-bottom: 2px;
25+
padding-left: 10px;
26+
padding-right: 10px;
27+
font-size: 0.7em;
28+
border-radius: 30px;
29+
background: linear-gradient(135deg, rgba($light-purple, 1) 0%, rgba($purple, 1) 100%);
30+
color: white;
31+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.250);
32+
}
33+
}
34+
1735
.completion-status {
1836
margin-left: 5px !important;
1937

0 commit comments

Comments
 (0)