-
Notifications
You must be signed in to change notification settings - Fork 8
Allow code panel to be resized #261
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8cc45af
Add ability to resize Code panel
alan412 ce488c6
Change to use the new collapse committment in the code display
alan412 f502b23
Change to make default starting size a percentage
alan412 d7a427a
Reverse arrow on right panel so it makes logical sense
alan412 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** | ||
* @license | ||
* Copyright 2025 Porpoiseful LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* @author [email protected] (Alan Smith) | ||
*/ | ||
import * as React from 'react'; | ||
import * as Antd from 'antd'; | ||
import { LeftOutlined, RightOutlined } from '@ant-design/icons'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
/** Props for the SiderCollapseTrigger component. */ | ||
interface SiderCollapseTriggerProps { | ||
collapsed: boolean; | ||
onToggle: () => void; | ||
} | ||
|
||
/** | ||
* Custom collapse trigger for Sider that matches the right panel's appearance. | ||
*/ | ||
export default function SiderCollapseTrigger(props: SiderCollapseTriggerProps): React.JSX.Element { | ||
const { token } = Antd.theme.useToken(); | ||
const { t } = useTranslation(); | ||
const [isHovered, setIsHovered] = React.useState(false); | ||
|
||
return ( | ||
<div | ||
style={{ | ||
position: 'absolute', | ||
bottom: 0, | ||
left: '50%', | ||
transform: 'translateX(-50%)', | ||
backgroundColor: isHovered ? token.colorBgTextHover : token.colorBgContainer, | ||
border: `1px solid ${token.colorBorder}`, | ||
borderBottom: 'none', | ||
borderRadius: '6px 6px 0 0', | ||
padding: '2px 6px', | ||
cursor: 'pointer', | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
minWidth: '24px', | ||
height: '22px', | ||
color: isHovered ? token.colorText : token.colorTextSecondary, | ||
transition: 'all 0.2s', | ||
zIndex: 1, | ||
}} | ||
onClick={props.onToggle} | ||
onMouseEnter={() => setIsHovered(true)} | ||
onMouseLeave={() => setIsHovered(false)} | ||
> | ||
<Antd.Tooltip title={props.collapsed ? t("EXPAND") : t("COLLAPSE")}> | ||
{props.collapsed ? | ||
<RightOutlined style={{ fontSize: '12px', color: 'inherit' }} /> : | ||
<LeftOutlined style={{ fontSize: '12px', color: 'inherit' }} /> | ||
} | ||
</Antd.Tooltip> | ||
</div> | ||
); | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.