Skip to content

Commit

Permalink
UI Enhancements (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyaskarnik committed Nov 17, 2023
1 parent 5e7fcc1 commit bd6b0f1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/pages/sidePanel/PageMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function switchToTab(tabId, pageURL) {
// eslint-disable-next-line react/prop-types
export default function PageMetadata({ metadata, taskType }) {
return metadata ? (
<div className={`page-metadata${taskType === 'summary' ? ' page-metadata-summary' : ''}`}>
<div className="page-metadata">
<div className="metadata-content">
{metadata.tabID && (
<div
Expand Down
6 changes: 4 additions & 2 deletions src/pages/sidePanel/PageSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ export default function PageSummary({ loading, summary, taskType }) {
<div>
{/* while loading show LinearProgress */}
{loading ? (
<div>
<div className="form-container">
<span>Generating summary...</span>
<LinearProgress color="primary" />
</div>
) : summary ? (
<div>
<div className="content-box">{summary.text}</div>
<PageMetadata metadata={summary} taskType={taskType} />
<div className="form-container">
<PageMetadata metadata={summary} taskType={taskType} />
</div>
</div>
) : null}
</div>
Expand Down
7 changes: 3 additions & 4 deletions src/pages/sidePanel/QandABubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PageMetadata from '@root/src/pages/sidePanel/PageMetadata';
/* eslint-disable react/prop-types */
export function QandAStatus({ embedding, vectorstore }) {
return (
<div>
<div className="form-container">
{/* while embedding==true show LinearProgress moving else show LinearProgress Solid */}
{embedding && vectorstore === null ? (
<div>
Expand Down Expand Up @@ -134,18 +134,17 @@ export function QandABubble({ taskType, selectedModel, vectorstore }) {
onKeyDown={handleKeyPress}
className="question-input"
style={{ overflowY: 'hidden' }} // Prevent scrollbar
disabled={answering}
/>
<button
type="submit"
className={`real-button ${question ? 'has-text' : ''}`}
disabled={answering} // this will disable the button when answering is true
>
<BsFillArrowRightSquareFill size="2rem" />
<BsFillArrowRightSquareFill size="2rem" className={answering ? 'spin' : ''} />
</button>
</div>
</form>
{/* <PageMetadata metadata={vectorstore} taskType={taskType} formContainerHeight={formContainerHeight} /> */}
<AnsweringStatus answering={answering} />
<PageMetadata metadata={vectorstore} taskType={taskType} />
</div>
</div>
Expand Down
21 changes: 15 additions & 6 deletions src/pages/sidePanel/SidePanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
/* Take the full width of the viewport */
background: #282c34;
/* Match the background of the .App */
padding: 20px;
/* padding: 20px; */
/* Add some padding around the form */
}

Expand Down Expand Up @@ -432,11 +432,6 @@
z-index: 10;
}

.page-metadata-summary {
position: fixed;
padding: 10px;
}

.metadata-content {
display: flex;
align-items: center;
Expand Down Expand Up @@ -535,3 +530,17 @@
border-radius: 4px !important;
overflow-x: auto !important;
}

@keyframes spin {
from {
transform: rotate(0deg);
}

to {
transform: rotate(360deg);
}
}

.spin {
animation: spin 2s linear infinite;
}

0 comments on commit bd6b0f1

Please sign in to comment.