Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/components/paneEditor.component.pug
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
| Pane Configuration

.pane-form
.form-group
label Name
input.form-control(
type='text',
[(ngModel)]='pane.name',
placeholder='Optional pane name'
)

.form-group
label Profile
select.form-control([(ngModel)]='pane.profileId')
Expand Down
36 changes: 26 additions & 10 deletions src/components/splitPreview.component.pug
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
.split-preview([class.horizontal]='split.orientation === "horizontal"', [class.vertical]='split.orientation === "vertical"', [class.nested]='depth > 0')
ng-container(*ngFor='let child of split.children; let i = index')
//- Resize handle between children
.resize-handle(
*ngIf='i > 0',
[class.horizontal]='split.orientation === "horizontal"',
[class.vertical]='split.orientation === "vertical"',
[class.dragging]='resizing && resizeIndex === i - 1',
(mousedown)='onResizeStart($event, i - 1)'
)

//- Pane
.preview-pane(
*ngIf='isPane(child)',
Expand All @@ -9,15 +18,18 @@
(contextmenu)='onContextMenu($event, asPane(child))'
)
.pane-content
.pane-label
| {{ getPaneLabel(asPane(child)) }}
.pane-details
.pane-detail(*ngIf='asPane(child).cwd', [title]='asPane(child).cwd')
i.fas.fa-folder
span {{ truncate(asPane(child).cwd, 20) }}
.pane-detail(*ngIf='asPane(child).startupCommand', [title]='asPane(child).startupCommand')
i.fas.fa-terminal
span {{ truncate(asPane(child).startupCommand, 20) }}
.pane-title
span.pane-name(*ngIf='asPane(child).name') {{ asPane(child).name }}
span.pane-sep(*ngIf='asPane(child).name') -
span.pane-profile {{ getPaneLabel(asPane(child)) }}
.pane-path(*ngIf='asPane(child).cwd') {{ asPane(child).cwd }}
.pane-command(*ngIf='asPane(child).startupCommand')
i.fas.fa-terminal
| {{ asPane(child).startupCommand }}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#5 — Percentage labels could be confusing

The width : height format shows global percentages like 50% : 100% or 25% : 50%. Two concerns:

  1. There's no indication which number is width vs height — users might misread it, especially for vertical splits where the "width" stays 100%.
  2. For deeply nested splits, values like 12% : 33% are technically correct but not intuitive.

Consider adding labels (W: 50% H: 100%) or only showing the dimension that the current split orientation controls (since the other is always inherited from the parent).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed format from 50% : 100% to W:50% H:100% with dedicated .dim-label styling (smaller font, lower opacity) so labels are subtle but clear. Verified on nested splits — shows W:13% H:100% correctly for a pane inside a 25%/50% hierarchy.

.pane-dimensions
span.dim-value {{ getPaneGlobalWidth(i) }}
span.dim-sep :
span.dim-value {{ getPaneGlobalHeight(i) }}

//- Nested split
split-preview(
Expand All @@ -26,6 +38,8 @@
[depth]='depth + 1',
[selectedPaneId]='selectedPaneId',
[profiles]='profiles',
[globalWidthRatio]='getChildGlobalWidth(i)',
[globalHeightRatio]='getChildGlobalHeight(i)',
[style.flex-basis]='getFlexStyle(i)',
(paneEdit)='onNestedPaneEdit($event)',
(splitHorizontal)='onNestedSplitH($event)',
Expand All @@ -34,7 +48,9 @@
(addRight)='onNestedAddRight($event)',
(addTop)='onNestedAddTop($event)',
(addBottom)='onNestedAddBottom($event)',
(removePane)='onNestedRemove($event)'
(removePane)='onNestedRemove($event)',
(ratioChange)='onNestedRatioChange()',
(resizeEnd)='onNestedResizeEnd()'
)

//- Context menu
Expand Down
132 changes: 101 additions & 31 deletions src/components/splitPreview.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
.split-preview {
display: flex;
width: 100%;
height: $preview-height;
gap: $spacing-sm;
height: 100%;
border-radius: $radius-md;
overflow: hidden;
background: var(--theme-bg);
Expand All @@ -20,13 +19,58 @@

&.nested {
height: auto;
border: 1px dashed var(--theme-fg-more);
border: 1px dashed rgba(255, 255, 255, 0.08);
background: $nested-split-bg;
padding: $spacing-sm;
border-radius: $radius-sm;
}
}

.resize-handle {
flex: 0 0 6px;
position: relative;
z-index: 1;
user-select: none;

&.horizontal {
cursor: col-resize;
}

&.vertical {
cursor: row-resize;
}

&::after {
content: '';
position: absolute;
border-radius: 1px;
background: var(--theme-border, $fallback-border);
transition: background $transition-fast;
}

&.horizontal::after {
top: 20%;
bottom: 20%;
left: 2px;
width: 2px;
}

&.vertical::after {
left: 20%;
right: 20%;
top: 2px;
height: 2px;
}

&:hover::after {
background: var(--theme-fg-more, rgba(255, 255, 255, 0.4));
}

&.dragging::after {
background: var(--theme-primary);
}
}

.preview-pane {
@include flex-center;
background: var(--theme-bg-more);
Expand All @@ -53,47 +97,73 @@
}

.pane-content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1px;
text-align: center;
padding: $spacing-md;
padding: $spacing-sm $spacing-md;
color: var(--theme-fg);
max-width: 100%;
overflow: hidden;
}

.pane-label {
font-size: 0.85rem;
font-weight: 600;
margin-bottom: $spacing-sm;
@include text-ellipsis;
.pane-title {
font-size: 0.75rem;
font-weight: 500;
overflow-wrap: break-word;

.pane-name {
font-weight: 600;
}

.pane-sep {
opacity: 0.4;
}

.pane-profile {
opacity: 0.8;
}
}

.pane-title,
.pane-profile {
font-size: 0.8rem;
font-weight: 500;
margin-bottom: $spacing-xs;
@include text-ellipsis;
.pane-path {
font-size: 0.6rem;
opacity: 0.6;
word-break: break-all;
}

.pane-details {
font-size: 0.7rem;
opacity: 0.7;
margin-top: $spacing-sm;
.pane-command {
font-size: 0.55rem;
opacity: 0.5;
overflow-wrap: break-word;

.pane-detail {
@include flex-center;
gap: $spacing-sm;
i {
font-size: 0.5rem;
}
}

i {
width: 12px;
text-align: center;
font-size: 0.65rem;
}
.pane-dimensions {
position: absolute;
bottom: $spacing-xs;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: baseline;
font-size: 0.65rem;
pointer-events: none;
color: var(--theme-primary);
white-space: nowrap;
opacity: 0.7;

span {
@include text-ellipsis;
max-width: 100px;
}
.dim-value {
min-width: 2.5em;
text-align: center;
}

.dim-sep {
opacity: 0.5;
margin: 0 2px;
}
}

Expand Down
Loading
Loading