-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: multiple tabs - [INS-4225] #8151
Open
CurryYangxx
wants to merge
46
commits into
develop
Choose a base branch
from
feat/multiple-tab
base: develop
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
46 commits
Select commit
Hold shift + click to select a range
2af849d
feat: multiple tabs
CurryYangxx 0d456cd
fix: lint error
CurryYangxx d540af4
fix: type error
CurryYangxx 3aa8229
fix: ui border align
CurryYangxx 9ec6c88
feat: sync with db
CurryYangxx 1b93389
feat: sync with database
CurryYangxx ba74e6a
ui improvement
CurryYangxx 136ecb1
fix: mock route display
CurryYangxx 7533f5e
add dropdown
CurryYangxx ba6ebf7
+ button
CurryYangxx 8b72a17
move search box to center
CurryYangxx 631dba1
fix: cannot del request tab
CurryYangxx ac6990c
fix ui
CurryYangxx b45dd27
tab background improvement
CurryYangxx 1b746e5
change tab background
CurryYangxx 384e034
feat: add list scroll
CurryYangxx 8d2d984
ui improvement
CurryYangxx 4b15b1f
feat: add tab contextmenu
CurryYangxx a446a4d
modify menu text
CurryYangxx c8c6965
fix(ui): tab disappear in panelgroup
CurryYangxx 8025145
feat: optimize tablist scroll button
CurryYangxx 4b127f5
add context menu enum
CurryYangxx fa8770d
del log
CurryYangxx 02e5bf2
fix: rename workspace
CurryYangxx 0f3d158
feat: scroll into view if needed
CurryYangxx aa6f02a
fix: runner request list not update after switch tab
CurryYangxx 23c1098
fix: runner not update
CurryYangxx 24824f0
feat: use different tab if for collection runner and folder runner
CurryYangxx b133698
fix: update tab data after move request or folder
CurryYangxx 6ec2cec
fix: database test
CurryYangxx cdb2f59
feat: support drag and drop
CurryYangxx 1381956
fix: ui
CurryYangxx ef84c32
cr feedback
CurryYangxx 50b6e82
fix tab update
CurryYangxx 90a7631
runner improvements (multiple tabs)-[INS-4779] (#8244)
CurryYangxx 89f0712
remove debugger
CurryYangxx 8169045
use own debounce instead lodash
CurryYangxx d8fe001
feat: move runner keep log to context
CurryYangxx 7dceca0
convert eventbus type enum to union
CurryYangxx 4cadc7b
reduce duplicate useInsomniaTabContext
CurryYangxx bab624c
fix search bar style
CurryYangxx 57cc613
covert enum to union
CurryYangxx 1e731ca
del log
CurryYangxx 2fc3f88
feat(tabs): keep connection for tabs-[INS-4778] (#8266)
CurryYangxx cec5994
fix: tab icon
CurryYangxx 4ab08e7
uppercase
CurryYangxx 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 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 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 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 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 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 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 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 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 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 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 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,34 @@ | ||
import classnames from 'classnames'; | ||
import React from 'react'; | ||
import { NavLink } from 'react-router-dom'; | ||
|
||
interface Props { | ||
organizationId: string; | ||
projectId: string; | ||
workspaceId: string; | ||
className?: string; | ||
} | ||
|
||
export const DocumentTab = ({ organizationId, projectId, workspaceId, className }: Props) => { | ||
return ( | ||
<nav className={`flex w-full h-[40px] items-center ${className} px-1 justify-around`}> | ||
{[ | ||
{ id: 'spec', name: 'Spec' }, | ||
{ id: 'debug', name: 'Collection' }, | ||
{ id: 'test', name: 'Tests' }, | ||
].map(item => ( | ||
<NavLink | ||
key={item.id} | ||
to={`/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/${item.id}`} | ||
className={({ isActive, isPending }) => classnames('text-center rounded-full px-2', { | ||
'text-[--color-font-surprise] bg-[--color-surprise]': isActive, | ||
'animate-pulse': isPending, | ||
})} | ||
data-testid={`workspace-${item.id}`} | ||
> | ||
{item.name} | ||
</NavLink> | ||
))} | ||
</nav> | ||
); | ||
}; |
This file contains 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 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.
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.
can you explain what behavior a ui tabs feature has which needs a new persistence layer feature. Is there an alternative way to achieve this behavior?
The reason I ask is this code is already hacked to achieve a sync side-effect so this smell like a hack too.
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.
We sync the tab states with the database by listening to the database's
onChange
event, such as changing a request's name or request method. Theonchange
event is triggered frequently, we only want to perform the corresponding update operation when certain fields are changed, because some of the update have heavy logic, such as move request or folder to another workspace. So, I addpatches
to the buffer to help us avoid some unnecessary operations.insomnia/packages/insomnia/src/ui/components/tabs/tabList.tsx
Line 153 in d0e9218