-
Notifications
You must be signed in to change notification settings - Fork 489
feat(agent-memory): add Agent Memory workspace Overview UI #6426
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
Open
booleanhunter
wants to merge
1
commit into
feature/agent-memory-inspector-api
from
feature/agent-memory-inspector-overview
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
redisinsight/ui/src/assets/img/agent-memory/agent-memory-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
redisinsight/ui/src/components/base/utils/VisuallyHidden.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { HTMLAttributes } from 'react' | ||
| import styled, { css } from 'styled-components' | ||
|
|
||
| /** | ||
| * Standard screen-reader-only ruleset: the element stays in the | ||
| * accessibility tree but is removed from the visual layout. | ||
| * Apply to any styled component via `${visuallyHiddenCss}` or render | ||
| * the ready-made <VisuallyHidden> span. | ||
| */ | ||
| export const visuallyHiddenCss = css` | ||
| position: absolute; | ||
| width: 1px; | ||
| height: 1px; | ||
| padding: 0; | ||
| margin: -1px; | ||
| overflow: hidden; | ||
| clip: rect(0, 0, 0, 0); | ||
| white-space: nowrap; | ||
| border: 0; | ||
| ` | ||
|
|
||
| export const VisuallyHidden = styled.span<HTMLAttributes<HTMLSpanElement>>` | ||
| ${visuallyHiddenCss} | ||
| ` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
redisinsight/ui/src/pages/agent-memory/home/AgentMemoryPage.styles.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import styled from 'styled-components' | ||
| import { Theme } from 'uiSrc/components/base/theme/types' | ||
| import { FlexItem } from 'uiSrc/components/base/layout/flex' | ||
| import { Page } from 'uiSrc/components/base/layout/page' | ||
|
|
||
| export const HomePage = styled(Page)` | ||
| padding: 1px ${({ theme }: { theme: Theme }) => theme.core.space.space200} | ||
| ${({ theme }: { theme: Theme }) => theme.core.space.space200}; | ||
| ` | ||
|
|
||
| export const EmptyPageContainer = styled(FlexItem)` | ||
| padding: ${({ theme }: { theme: Theme }) => theme.core.space.space300}; | ||
| border: 1px solid | ||
| ${({ theme }: { theme: Theme }) => theme.semantic.color.border.neutral500}; | ||
| border-radius: ${({ theme }: { theme: Theme }) => | ||
| theme.components.card.borderRadius}; | ||
| ` |
122 changes: 122 additions & 0 deletions
122
redisinsight/ui/src/pages/agent-memory/home/AgentMemoryPage.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| import React, { useEffect, useState } from 'react' | ||
| import { useHistory } from 'react-router-dom' | ||
|
|
||
| import { useAppSelector } from 'uiSrc/slices/hooks' | ||
| import { dispatch } from 'uiSrc/slices/store' | ||
| import { | ||
| agentMemoryEndpointsSelector, | ||
| connectEndpointAction, | ||
| createEndpointAction, | ||
| editEndpointAction, | ||
| fetchEndpointsAction, | ||
| } from 'uiSrc/slices/agentMemory/endpoints' | ||
| import { AgentMemoryEndpoint } from 'uiSrc/slices/interfaces/agentMemory' | ||
| import { Pages } from 'uiSrc/constants' | ||
| import { setTitle, Nullable } from 'uiSrc/utils' | ||
| import HomePageTemplate from 'uiSrc/templates/home-page-template' | ||
| import { PageBody } from 'uiSrc/components/base/layout/page' | ||
| import { Row } from 'uiSrc/components/base/layout/flex' | ||
| import { Spacer } from 'uiSrc/components/base/layout/spacer' | ||
| import { PrimaryButton } from 'uiSrc/components/base/forms/buttons' | ||
| import { PlusIcon } from 'uiSrc/components/base/icons' | ||
| import { RiBadge } from 'uiSrc/components/base/display/badge/RiBadge' | ||
| import { Title } from 'uiSrc/components/base/text' | ||
|
|
||
| import EndpointsList from './components/endpoints-list/EndpointsList' | ||
| import EmptyMessage from './components/empty-message/EmptyMessage' | ||
| import EndpointConnectionFormWrapper from './components/connection-form/EndpointConnectionFormWrapper' | ||
| import * as S from './AgentMemoryPage.styles' | ||
|
|
||
| const PAGE_TITLE = 'Agent Memory' | ||
|
|
||
| const AgentMemoryPage = () => { | ||
| const history = useHistory() | ||
| const { data, loading, loadingChanging } = useAppSelector( | ||
| agentMemoryEndpointsSelector, | ||
| ) | ||
|
|
||
| const [isFormOpen, setIsFormOpen] = useState(false) | ||
| const [editEndpoint, setEditEndpoint] = | ||
| useState<Nullable<AgentMemoryEndpoint>>(null) | ||
|
|
||
| const hideList = data.length === 0 && !loading && !loadingChanging | ||
|
|
||
| useEffect(() => { | ||
| dispatch(fetchEndpointsAction()) | ||
| setTitle(PAGE_TITLE) | ||
| }, []) | ||
|
|
||
| const handleOpenForm = () => { | ||
| setEditEndpoint(null) | ||
| setIsFormOpen(true) | ||
| } | ||
|
|
||
| const handleCloseForm = () => { | ||
| setEditEndpoint(null) | ||
| setIsFormOpen(false) | ||
| } | ||
|
|
||
| const handleEdit = (endpoint: AgentMemoryEndpoint) => { | ||
| setEditEndpoint(endpoint) | ||
| setIsFormOpen(true) | ||
| } | ||
|
|
||
| const handleConnect = (endpoint: AgentMemoryEndpoint) => { | ||
| dispatch( | ||
| connectEndpointAction(endpoint.id, () => | ||
| history.push(Pages.agentMemoryWorkspace(endpoint.id)), | ||
| ), | ||
| ) | ||
| } | ||
|
|
||
| const handleFormSubmit = (endpoint: Partial<AgentMemoryEndpoint>) => { | ||
| if (editEndpoint) { | ||
| dispatch(editEndpointAction(editEndpoint.id, endpoint, handleCloseForm)) | ||
| } else { | ||
| dispatch(createEndpointAction(endpoint, handleCloseForm)) | ||
| } | ||
| } | ||
|
|
||
| return ( | ||
| <HomePageTemplate> | ||
| <S.HomePage className="homePage"> | ||
| <PageBody component="div"> | ||
| <Row align="center" justify="between" grow={false}> | ||
| <Row align="center" gap="m" grow={false}> | ||
| <Title size="M">{PAGE_TITLE}</Title> | ||
| <RiBadge | ||
| label="Preview" | ||
| variant="notice" | ||
| data-testid="agent-memory-preview-badge" | ||
| /> | ||
| </Row> | ||
| {!hideList && ( | ||
| <PrimaryButton | ||
| data-testid="agent-memory-add-endpoint-button" | ||
| icon={PlusIcon} | ||
| onClick={handleOpenForm} | ||
| > | ||
| Agent memory endpoint | ||
| </PrimaryButton> | ||
| )} | ||
| </Row> | ||
| <Spacer size="m" /> | ||
| {hideList ? ( | ||
| <EmptyMessage onAddClick={handleOpenForm} /> | ||
| ) : ( | ||
| <EndpointsList onEdit={handleEdit} onConnect={handleConnect} /> | ||
| )} | ||
| <EndpointConnectionFormWrapper | ||
| isOpen={isFormOpen} | ||
| onSubmit={handleFormSubmit} | ||
| onCancel={handleCloseForm} | ||
| editEndpoint={editEndpoint} | ||
| isLoading={loading || loadingChanging} | ||
| /> | ||
| </PageBody> | ||
| </S.HomePage> | ||
| </HomePageTemplate> | ||
| ) | ||
| } | ||
|
|
||
| export default AgentMemoryPage | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When RedisInsight is running in Bulgarian, this title and the other newly added Agent Memory labels, buttons, placeholders, errors, and dialog text remain in English because they are literals rather than
t/Transkeys; only the success notification was added to the locale files. Move the new user-facing copy into matchingen.jsonandbg.jsonkeys so the entire feature follows the selected locale.AGENTS.md reference: AGENTS.md:L127-L127
Useful? React with 👍 / 👎.