Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fs-103 View Report UI #43

Merged
merged 4 commits into from
Dec 5, 2024
Merged

Fs-103 View Report UI #43

merged 4 commits into from
Dec 5, 2024

Conversation

dianaPrahoveanu-SL
Copy link
Collaborator

@dianaPrahoveanu-SL dianaPrahoveanu-SL commented Dec 3, 2024

Description

Displays the generated report from the uploaded file in the side panel.

image

image

Changelog

  • Display a message informing the user that a report has been generated from the uploaded file
  • The report shows up in the side panel when users click the "View Report" button
  • Updated the side panel's title area UI

@@ -29,17 +31,19 @@ export const App = () => {
<div className={styles.container}>
{selectedMessage && (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once @mic-smith has done the grid work this will need to be conditional also on there being a report as it will be different for grid. I assume he can do that change later though

@evpearce
Copy link
Collaborator

evpearce commented Dec 3, 2024

Looks good to me but I won't approve cause I worked on it too

@@ -45,6 +45,7 @@
"dependencies": {
"classnames": "^2.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-markdown": "^8.0.6"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we don't have the latest version of react-markdown? e.g. "^9.0.1"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I googled react markdown and the copied the install script from the npm page, hadn't realised that it wasn't the latest, good spot. @dianaPrahoveanu-SL would you mind updating it?

align-items: center;
justify-content: space-between;
height: 56px;
margin: -16px;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any simple alternatives to negative margins here?

Copy link
Collaborator Author

@dianaPrahoveanu-SL dianaPrahoveanu-SL Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on this now. The reason I added it is to make sure the padding of the column element doesn't affect the report title. This way, the UI lines up with the UX specs.

Copy link
Collaborator

@mic-smith mic-smith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small comments, but looks good to me.

setUploadedFile(file);
appendMessage(
{ answer: 'Your report is ready to view.' },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the file name in, something like: "Your ESG report for file_name is ready to view."

@@ -59,12 +61,12 @@ export const MessageComponent = ({
<img src={icon} className={styles.iconStyle} />
<p className={styles.messageStyle}>{content}</p>
</div>
{role == Role.Bot && false && (
{report && (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could potentially make this more generic, i.e. openSidePanel with the button text variable being named openSidePanelButtonText, this would prepare us for when the datagrid piece comes through - unless @mic-smith wanted to make this refactor in his own work?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm happy to make this change in my PR as I need to edit this anyway

@@ -18,6 +18,8 @@ export interface Message {
content: string;
reasoning?: string;
time: string;
report?: string;
filename?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be getting lost, is filename used in here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, on the app.tsx file I use it to pass the filename of the file uploaded to the title of the ESG report.

response: ChatMessageResponse,
role: Role,
report?: string,
filename?: string,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly we could rename these to sidePanelContent and sidePanelTitle?

{ answer: `Your ESG report for ${filename} is ready to view.` },
Role.Bot,
report,
filename,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of passing in filename, can we pass in `ESG Report - ${filename}`

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will allow us to pass in a different title for the data grid, rather than having the component always add ESG Report - in front of every sidePanelTitle

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense. Will change now

<div className={styles.selectMessage}>
<Button
isOutline
isPressed={message === selectedMessage}
text="Select message"
text="View Report"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also pass buttonText in? This way Mike will be able to pass in View Data or something like this

@dianaPrahoveanu-SL dianaPrahoveanu-SL merged commit 785f13f into main Dec 5, 2024
4 checks passed
@dianaPrahoveanu-SL dianaPrahoveanu-SL deleted the FS-103-view-report-ui branch December 5, 2024 11:01
dianaPrahoveanu-SL added a commit that referenced this pull request Dec 9, 2024
* FS-103 view report ui

* Updated sidepanel title UI & linked report

* PR comments- Mike

* PR comments- Ivan

---------

Co-authored-by: Emma Pearce <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants