-
Notifications
You must be signed in to change notification settings - Fork 1
DX-1485: Multi tabs and search history #17
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
ytkimirti
wants to merge
26
commits into
master
Choose a base branch
from
DX-1485
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
65458ea
feat: add multiple tab support
ytkimirti ab3be4c
feat: add search history
ytkimirti ee65c53
feat: add keyboard support to the search
ytkimirti 669505b
chore: unused import
ytkimirti 076d253
chore: remove unusued hook
ytkimirti 2921747
chore: rename the custom scroll component argument
ytkimirti 92f561e
chore: update playground for easier debugging
ytkimirti f00dcf6
feat: add hideTabs option and fix styles
ytkimirti db7492e
feat: add a credentials form to playground
ytkimirti 792425f
fix: use cloudflare version of redis to avoid direct process access
ytkimirti f9fbfc0
Merge branch 'master' into DX-1485
ytkimirti a6e1620
feat: add persistance support
ytkimirti 8f7b999
fix: prevent useEffect from working when tab is not active
ytkimirti 49fd950
fix: automatically rescan until a result shows up
ytkimirti a8dd13c
fix: only fetch when the tab is active
ytkimirti 6fc3865
fix: skeleton and empty styles
ytkimirti c037dc3
fix: refactor tabs and improve next tab selection logic when current …
ytkimirti f9995f5
feat: add useOverflow utility hook
ytkimirti 3faf449
fix: make the tooltip use portals
ytkimirti 4a8fac7
fix: search recomendations overflowing
ytkimirti 44f54dc
feat: show tooltip only when tabs is overflowing
ytkimirti f7efb5c
fix: adding new key sometimes throwing error
ytkimirti 5bc9a90
fix: not being able to click anywhere after closing delete key modal
ytkimirti d30c551
feat: add "copy key" to dropdown menu
ytkimirti 2d7875d
feat: make the "delete key" item red
ytkimirti 3ae114f
fix: add zustand migration
ytkimirti 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
Binary file not shown.
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
32 changes: 32 additions & 0 deletions
32
src/components/databrowser/components/databrowser-instance.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,32 @@ | ||
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels" | ||
|
||
import { cn } from "@/lib/utils" | ||
import { Toaster } from "@/components/ui/toaster" | ||
import { DataDisplay } from "./display" | ||
import { Sidebar } from "./sidebar" | ||
import { KeysProvider } from "../hooks/use-keys" | ||
|
||
export const DatabrowserInstance = ({ hidden }: { hidden?: boolean }) => { | ||
return ( | ||
<KeysProvider> | ||
<div className={cn("min-h-0 grow rounded-md bg-zinc-100", hidden && "hidden")}> | ||
<PanelGroup | ||
autoSaveId="persistence" | ||
direction="horizontal" | ||
className="h-full w-full gap-0.5 text-sm antialiased" | ||
> | ||
<Panel defaultSize={30} minSize={30}> | ||
<Sidebar /> | ||
</Panel> | ||
<PanelResizeHandle className="group flex h-full w-3 justify-center"> | ||
<div className="h-full border-r border-dashed border-zinc-200 transition-colors group-hover:border-zinc-500" /> | ||
</PanelResizeHandle> | ||
<Panel minSize={40}> | ||
<DataDisplay /> | ||
</Panel> | ||
</PanelGroup> | ||
<Toaster /> | ||
</div> | ||
</KeysProvider> | ||
) | ||
} |
33 changes: 33 additions & 0 deletions
33
src/components/databrowser/components/databrowser-tabs.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,33 @@ | ||
import { IconPlus } from "@tabler/icons-react" | ||
import { Button } from "@/components/ui/button" | ||
import type { TabId } from "@/store" | ||
import { useDatabrowserStore } from "@/store" | ||
import { TabIdProvider } from "@/tab-provider" | ||
import { Tab } from "./tab" | ||
|
||
export const DatabrowserTabs = () => { | ||
const { tabs, addTab } = useDatabrowserStore() | ||
|
||
return ( | ||
<div className="relative mb-2 shrink-0"> | ||
<div className="absolute bottom-0 left-0 right-0 -z-10 h-[1px] w-full bg-zinc-200" /> | ||
|
||
<div className="scrollbar-hide flex translate-y-[1px] items-center gap-1 overflow-x-scroll pb-[1px] [&::-webkit-scrollbar]:hidden"> | ||
{tabs.map(([id]) => ( | ||
<TabIdProvider key={id} value={id as TabId}> | ||
<Tab id={id} /> | ||
</TabIdProvider> | ||
))} | ||
<Button | ||
variant="secondary" | ||
size="icon-sm" | ||
onClick={addTab} | ||
className="mr-1 flex-shrink-0" | ||
title="Add new tab" | ||
> | ||
<IconPlus className="text-zinc-500" size={16} /> | ||
</Button> | ||
</div> | ||
</div> | ||
) | ||
} |
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
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
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.
The new
useTab
hook is used in many child components but there's noTabProvider
wrapping the tree. Wrap the content (e.g., aroundKeysProvider
) with<TabProvider>
so thatuseTab
has the required context.Copilot uses AI. Check for mistakes.