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

UI Enhancements #33

Merged
merged 23 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}