diff --git a/src/app/App.tsx b/src/app/App.tsx index 6ae7687..755f0c8 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -88,114 +88,40 @@ export function App(): React.JSX.Element { return ( -
+
- {error &&
Pieces OS is not running in the background. Click You're Not Connected to connect
} -
-
-

Workflow Activity

+ {error &&
Pieces OS is not running in the background. Click You're Not Connected to connect
} +
+
+

Workflow Activity

-
-
- -
-

Saved Snippets

- -
-
+
{array.map((item: LocalAsset, index) => (
handleSelect(index)} >

{item.name}

-
+

{item.id}

{item.classification}

@@ -206,8 +132,8 @@ export function App(): React.JSX.Element {
-
-

Create a New Snippet

+
+

Create a New Snippet

@@ -216,18 +142,7 @@ export function App(): React.JSX.Element {
{/* this is the copilot container. the copilot logic is inside the /components/Copilot.tsx */} -
+
diff --git a/src/app/components/Copilot/Copilot.tsx b/src/app/components/Copilot/Copilot.tsx index 0759288..5e700b0 100644 --- a/src/app/components/Copilot/Copilot.tsx +++ b/src/app/components/Copilot/Copilot.tsx @@ -140,12 +140,22 @@ export function CopilotChat(): React.JSX.Element { const getInitialChat = async () => { let _name: string; - await new Pieces.ConversationsApi().conversationsSnapshot({}).then(output => { - _name = output.iterable.at(0).name; - GlobalConversationID = output.iterable.at(0).id; - return output.iterable.at(0).name - }); - setChatSelected(_name); + await new Pieces.ConversationsApi() + .conversationsSnapshot({}) + .then((output) => { + if ( + output.iterable.length > 0 && + output.iterable.at(0).hasOwnProperty("name") + ) { + _name = output.iterable.at(0).name; + GlobalConversationID = output.iterable.at(0).id; + } + return _name; + }); + + if (_name) { + setChatSelected(_name); + } }; getInitialChat(); }, []); diff --git a/src/app/global.css b/src/app/global.css index b2dcd9f..1a9e165 100644 --- a/src/app/global.css +++ b/src/app/global.css @@ -1,7 +1,7 @@ - +/* */ html { - font-family: 'Roboto', sans-serif; + font-family: "Roboto", sans-serif; } ::-webkit-scrollbar { @@ -21,4 +21,151 @@ html { background-color: #b3b2b2; } +.container { + padding: 10px 20px; +} + +.error-container { + border: 2px solid black; + background-color: #0e1111; + color: red; + /* minWidth: '1175px', + maxWidth: '1175px', */ + padding: 20px; + border-radius: 9px; + display: flex; + box-shadow: -4px 4px 5px rgba(0, 0, 0, 0.2); + margin-bottom: 10px; +} + +.flex-container { + display: flex; + flex: 1; + flex-direction: row-reverse; +} + +.workflow-activity-container { + border: 2px solid black; + background-color: #0e1111; + height: 600px; + min-width: 250px; + /* maxWidth: '1175px', */ + padding: 20px; + border-radius: 9px; + display: flex; + flex: 1; + flex-direction: column; + box-shadow: -4px 4px 5px rgba(0, 0, 0, 0.2); +} + +.activity-heading { + color: white; + font-weight: normal; +} + +.snippets-container { + /* width: "auto", */ + border: 2px solid yellow; + background-color: #0e1111; + height: 600px; + min-width: 1000px; + /* maxWidth: '1175px', */ + padding: 20px; + border-radius: 9px; + display: flex; + flex: 1; + margin-right: 10px; + box-shadow: -4px 4px 5px rgba(0, 0, 0, 0.2); +} + +.snippets-header { + min-height: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.snippets-subheader { + display: flex; + flex-direction: row; + align-items: center; +} + +.snippets-heading { + color: white; + font-weight: normal; + margin: 5px; +} + +.snippets-heading-2 { + color: white; + font-weight: normal; +} + +.snippet-grid-container { + display: flex; + flex-direction: column; + padding: 10px; + max-height: 90%; + align-self: end; + margin-left: 10px; +} + +.refresh-btn, +.deselect-btn { + max-width: fit-content; + height: fit-content; + margin-left: 10px; + background-color: black; + border: 1px solid white; + border-radius: 5px; + padding: 8px 24px; + color: white; + flex-wrap: nowrap; + cursor: pointer; + font-size: 12px; +} + +.snippets-grid { + overflow-y: scroll; + min-width: 700px; + min-height: 80%; + padding-right: 5px; + display: grid; + grid-template-columns: repeat(3, 1fr); + grid-template-rows: repeat(3, 1fr); + gap: 5px; +} + +.snippet-item { + margin: 5px; + align-items: center; + padding: 10px; + border-radius: 5px; + height: 200px; + width: 200px; + display: flex; + flex-direction: row; + justify-content: space-between; + /* background-color: white; */ + cursor: pointer; /* Add cursor style to indicate clickability */ +} + +.snippet-item.selected { + background-color: lightblue; +} + +.snippet-details { + flex-direction: column; +} +.copilot-container { + border: 2px solid black; + background-color: #0e1111; + height: 600px; + padding: 20px; + border-radius: 9px; + display: flex; + box-shadow: -4px 4px 5px rgba(0, 0, 0, 0.2); + margin-top: 20px; +}