Skip to content

Commit

Permalink
Merge pull request #690 from StampyAI/Ticket-#653-&-#598-Updates
Browse files Browse the repository at this point in the history
formatting chat messages, typo fix
  • Loading branch information
melissasamworth committed Jun 6, 2024
2 parents 1bf1f28 + 3858780 commit 4c7c229
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
10 changes: 4 additions & 6 deletions app/components/Button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
border-width: 0;
line-height: 0;
background: inherit;
cursor: pointer;
}

/* style */
Expand Down Expand Up @@ -172,7 +173,7 @@
}

.active {
background-color: var(----colors-teal-50);
background-color: var(--colors-teal-50);
}

.inactive:hover {
Expand All @@ -181,7 +182,6 @@

/* #### Composite button #### */
.composite-button {
box-shadow: 0px var(--spacing-16) var(--spacing-40) 0px rgba(175, 183, 194, 0.2);
cursor: pointer;
}

Expand Down Expand Up @@ -255,13 +255,11 @@
left: 50%;
transform: translateX(-50%);
background-color: #1b2b3e;
font-size: 14px;
color: #f2f2f2;
padding: 5px 15px;
border-radius: var(--spacing-8);
padding: var(--spacing-8) var(--spacing-16);
border-radius: var(--border-radius);
white-space: nowrap;
pointer-events: none;
line-height: var(--spacing-32);
}

.button.full-width {
Expand Down
6 changes: 3 additions & 3 deletions app/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Button = ({
{...props}
>
{children}
{secondary && tooltip && !disabled && <p className="tool-tip-secondary">{tooltip}</p>}
{secondary && tooltip && !disabled && <p className="tool-tip-secondary xs">{tooltip}</p>}
</Link>
)
}
Expand All @@ -56,7 +56,7 @@ const Button = ({
{...props}
>
{children}
{secondary && tooltip && !disabled && <p className="tool-tip-secondary">{tooltip}</p>}
{secondary && tooltip && !disabled && <p className="tool-tip-secondary xs">{tooltip}</p>}
</button>
)
}
Expand All @@ -68,7 +68,7 @@ export interface CompositeButtonProps {
}
export const CompositeButton = ({children, className = '', secondary}: CompositeButtonProps) => (
<div
className={`${(secondary ? 'composite-button-secondary' : 'composite-button') + ' ' + className}`}
className={`shadowed ${(secondary ? 'composite-button-secondary' : 'composite-button') + ' ' + className}`}
>
{children}
</div>
Expand Down
15 changes: 8 additions & 7 deletions app/components/Chatbot/ChatEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,21 +143,22 @@ const ChatbotReply = ({question, phase, content, citationsMap}: AssistantEntry)
citations.push(v)
})
citations.sort((a, b) => a.index - b.index)
const phaseMessageClass = 'phase-message large-reading'

const PhaseState = () => {
switch (phase) {
case 'started':
return <p>Loading: Sending query...</p>
return <p className={phaseMessageClass}>Loading: Sending query...</p>
case 'semantic':
return <p>Loading: Performing semantic search...</p>
return <p className={phaseMessageClass}>Loading: Performing semantic search...</p>
case 'history':
return <p>Loading: Processing history...</p>
return <p className={phaseMessageClass}>Loading: Processing history...</p>
case 'context':
return <p>Loading: Creating context...</p>
return <p className={phaseMessageClass}>Loading: Creating context...</p>
case 'prompt':
return <p>Loading: Creating prompt...</p>
return <p className={phaseMessageClass}>Loading: Creating prompt...</p>
case 'llm':
return <p>Loading: Waiting for LLM...</p>
return <p className={phaseMessageClass}>Loading: Waiting for LLM...</p>
case 'streaming':
case 'followups':
default:
Expand Down Expand Up @@ -211,7 +212,7 @@ const ChatbotReply = ({question, phase, content, citationsMap}: AssistantEntry)
]}
/>
) : undefined}
{phase === 'followups' ? <p>Checking for followups...</p> : undefined}
{phase === 'followups' ? <p className="followups">Checking for followups...</p> : undefined}
</div>
)
}
Expand Down
10 changes: 10 additions & 0 deletions app/components/Chatbot/chat_entry.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ article.stampy {
align-items: center;
}

.phase-message {
margin-left: 57px;
color: var(--colors-cool-grey-600);
}

.followups {
margin-top: var(--spacing-16);
color: var(--colors-cool-grey-600);
}

.chat-entry .info {
display: flex;
gap: var(--spacing-8);
Expand Down
2 changes: 1 addition & 1 deletion app/components/Chatbot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const QuestionInput = ({
<div className="flex-container">
<Input
placeholder={placeholder}
className={'large full-width ' + (fixed ? '' : 'shadowed')}
className="large full-width shadowed"
value={question}
onChange={(e) => handleChange(e.target.value)}
onKeyDown={(e) => {
Expand Down
2 changes: 1 addition & 1 deletion app/components/Chatbot/widgit.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@
width: calc(100% + 2000px);
height: 100px;
top: 100%;
z-index: 1000;
z-index: -1;
background: #ffffff;
}
2 changes: 1 addition & 1 deletion app/root.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
--colors-green-500: #40c075;

/* spacing - user everywhere for padding and margin */
--border-radius: 4px;
--border-radius: 6px;
--spacing-4: 4px;
--spacing-8: 8px;
--spacing-12: 12px;
Expand Down

0 comments on commit 4c7c229

Please sign in to comment.