Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
improve folder chip look in chat (#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiya1155 authored Oct 3, 2023
1 parent 6f86a0c commit 7e2cf6b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 16 deletions.
2 changes: 1 addition & 1 deletion client/src/components/IdeNavigation/DirEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const DirEntry = ({
className="flex flex-col transition-all ease-linear overflow-hidden flex-shrink-0 w-full min-w-fit"
>
<a
className={`min-w-full w-max text-left h-7 flex items-center gap-1.5 py-2 px-3 cursor-pointer caption group
className={`min-w-full w-max text-left h-7 flex-shrink-0 flex items-center gap-1.5 py-2 px-3 cursor-pointer caption group
${
currentPath === fullPath
? 'bg-bg-main/15 text-label-title'
Expand Down
35 changes: 20 additions & 15 deletions client/src/components/MarkdownWithCode/FolderChip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { buildRepoQuery } from '../../utils';
import { Directory } from '../../types/api';
import { SyncStatus } from '../../types/general';
import { AppNavigationContext } from '../../context/appNavigationContext';
import OverflowTracker from '../OverflowTracker';

type Props = {
onClick: () => void;
Expand Down Expand Up @@ -57,22 +58,26 @@ const FolderChip = ({ onClick, path, repoName, selectedBranch }: Props) => {
</span>
</button>
<div
className={`w-full my-4 p-4 bg-bg-shade text-sm border border-bg-border rounded-md relative max-h-80 overflow-auto`}
className={
'w-full flex flex-col my-1 folder-chip text-sm border border-bg-border rounded-md overflow-auto max-h-80 p-1'
}
>
<DirEntry
name={path}
isDirectory
level={0}
currentPath={''}
fetchFiles={fetchFiles}
fullPath={path}
navigateToPath={navigateToPath}
defaultOpen
indexed
repoRef={''}
repoStatus={SyncStatus.Done}
refetchParentFolder={() => {}}
/>
<OverflowTracker className="auto-fade-vertical">
<DirEntry
name={path}
isDirectory
level={0}
currentPath={''}
fetchFiles={fetchFiles}
fullPath={path}
navigateToPath={navigateToPath}
defaultOpen
indexed
repoRef={''}
repoStatus={SyncStatus.Done}
refetchParentFolder={() => {}}
/>
</OverflowTracker>
</div>
</>
);
Expand Down
25 changes: 25 additions & 0 deletions client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,26 @@ h5, .h5 {
--end-fade: var(--fade-length);
}

.auto-fade-vertical {
overflow-x: scroll;
--fade-length: 40px;
--start-fade: 0px;
--end-fade: 0px;
-webkit-mask: linear-gradient(
to bottom,
transparent,
black var(--start-fade),
black calc(100% - var(--end-fade)),
transparent
);
}
.auto-fade-vertical[data-overflow-top] {
--start-fade: var(--fade-length);
}
.auto-fade-vertical[data-overflow-bottom] {
--end-fade: var(--fade-length);
}

.backdrop-blur-0 {
backdrop-filter: blur(0);
-webkit-backdrop-filter: blur(0);
Expand Down Expand Up @@ -1404,6 +1424,11 @@ h5, .h5 {
padding: 2px 4px;
}

.code-studio-md .folder-chip a {
background-color: transparent;
border: unset;
}

.article-response li>p, .code-studio-md li>p {
margin: 0;
display: unset;
Expand Down

0 comments on commit 7e2cf6b

Please sign in to comment.