-
Notifications
You must be signed in to change notification settings - Fork 774
Tab background glow on process exit/bell #2835
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,28 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Copyright 2024, Command Line Inc. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // SPDX-License-Identifier: Apache-2.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Animate a shared breathing phase on :root so all indicator tabs pulse in sync. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Uses CSS @property for an animatable custom property (Chromium 78+). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @property --breathe-phase { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| syntax: "<number>"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| initial-value: 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| inherits: true; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| :root { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| animation: indicatorBreathePhase 16s ease-in-out infinite; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @keyframes indicatorBreathePhase { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 0%, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100% { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --breathe-phase: 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50% { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --breathe-phase: 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .tab { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| position: absolute; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| width: 130px; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -46,6 +68,8 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .name { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: var(--main-text-color); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-weight: 700; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| filter: brightness(1.15); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| & + .tab::after, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -96,6 +120,24 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| transition: none !important; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| &.has-indicator { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .tab-inner { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: rgb(from var(--tab-indicator-color) r g b / 0.15); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| &.active .tab-inner { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: rgb(from var(--tab-indicator-color) r g b / 0.2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| &.indicator-breathing { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .tab-inner { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: rgb(from var(--tab-indicator-color) r g b / calc(0.08 + var(--breathe-phase) * 0.14)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| &.active .tab-inner { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: rgb(from var(--tab-indicator-color) r g b / calc(0.12 + var(--breathe-phase) * 0.14)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+123
to
+139
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stylelint: use percentage alpha notation and add empty lines before nested rules. Static analysis flags Proposed fix &.has-indicator {
.tab-inner {
- background: rgb(from var(--tab-indicator-color) r g b / 0.15);
+ background: rgb(from var(--tab-indicator-color) r g b / 15%);
}
+
&.active .tab-inner {
- background: rgb(from var(--tab-indicator-color) r g b / 0.2);
+ background: rgb(from var(--tab-indicator-color) r g b / 20%);
}
}
&.indicator-breathing {
.tab-inner {
background: rgb(from var(--tab-indicator-color) r g b / calc(0.08 + var(--breathe-phase) * 0.14));
}
+
&.active .tab-inner {
background: rgb(from var(--tab-indicator-color) r g b / calc(0.12 + var(--breathe-phase) * 0.14));
}
}📝 Committable suggestion
Suggested change
🧰 Tools🪛 Stylelint (17.2.0)[error] 125-125: Expected "0.15" to be "15%" (alpha-value-notation) (alpha-value-notation) [error] 128-128: Expected "0.2" to be "20%" (alpha-value-notation) (alpha-value-notation) [error] 127-129: Expected empty line before rule (rule-empty-line-before) (rule-empty-line-before) [error] 136-138: Expected empty line before rule (rule-empty-line-before) (rule-empty-line-before) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .wave-button { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| position: absolute; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| top: 50%; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -129,6 +171,18 @@ body:not(.nohover) .tab.dragging { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-color: transparent; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: rgb(from var(--main-text-color) r g b / 0.1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| &.has-indicator .tab-inner { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: rgb(from var(--tab-indicator-color) r g b / 0.15); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| &.has-indicator.active .tab-inner { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: rgb(from var(--tab-indicator-color) r g b / 0.2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| &.indicator-breathing .tab-inner { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: rgb(from var(--tab-indicator-color) r g b / calc(0.08 + var(--breathe-phase) * 0.14)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| &.indicator-breathing.active .tab-inner { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background: rgb(from var(--tab-indicator-color) r g b / calc(0.12 + var(--breathe-phase) * 0.14)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+174
to
+185
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same Stylelint fixes needed in the hover/drag block. The same Proposed fix+
&.has-indicator .tab-inner {
- background: rgb(from var(--tab-indicator-color) r g b / 0.15);
+ background: rgb(from var(--tab-indicator-color) r g b / 15%);
}
+
&.has-indicator.active .tab-inner {
- background: rgb(from var(--tab-indicator-color) r g b / 0.2);
+ background: rgb(from var(--tab-indicator-color) r g b / 20%);
}
+
&.indicator-breathing .tab-inner {
background: rgb(from var(--tab-indicator-color) r g b / calc(0.08 + var(--breathe-phase) * 0.14));
}
+
&.indicator-breathing.active .tab-inner {
background: rgb(from var(--tab-indicator-color) r g b / calc(0.12 + var(--breathe-phase) * 0.14));
}📝 Committable suggestion
Suggested change
🧰 Tools🪛 Stylelint (17.2.0)[error] 175-175: Expected "0.15" to be "15%" (alpha-value-notation) (alpha-value-notation) [error] 178-178: Expected "0.2" to be "20%" (alpha-value-notation) (alpha-value-notation) [error] 174-176: Expected empty line before rule (rule-empty-line-before) (rule-empty-line-before) [error] 177-179: Expected empty line before rule (rule-empty-line-before) (rule-empty-line-before) [error] 180-182: Expected empty line before rule (rule-empty-line-before) (rule-empty-line-before) [error] 183-185: Expected empty line before rule (rule-empty-line-before) (rule-empty-line-before) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .close { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| visibility: visible; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| &:hover { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -355,7 +355,7 @@ func (bc *ShellController) getConnUnion(logCtx context.Context, remoteName strin | |
| if err != nil { | ||
| return ConnUnion{}, fmt.Errorf("invalid ssh remote name (%s): %w", remoteName, err) | ||
| } | ||
| conn := conncontroller.MaybeGetConn(opts) | ||
| conn := conncontroller.GetConn(opts) | ||
| if conn == nil { | ||
| return ConnUnion{}, fmt.Errorf("ssh connection not found: %s", remoteName) | ||
| } | ||
|
|
@@ -526,6 +526,34 @@ func (bc *ShellController) manageRunningShellProcess(shellProc *shellexec.ShellP | |
| shellInputCh := make(chan *BlockInputUnion, 32) | ||
| bc.ShellInputCh = shellInputCh | ||
|
|
||
| // Fire amber "running" indicator for cmd blocks | ||
| if bc.ControllerType == BlockController_Cmd { | ||
| exitIndicatorEnabled := blockMeta.GetBool(waveobj.MetaKey_TermExitIndicator, false) | ||
| if !blockMeta.HasKey(waveobj.MetaKey_TermExitIndicator) { | ||
| if globalVal := wconfig.GetWatcher().GetFullConfig().Settings.TermExitIndicator; globalVal != nil { | ||
| exitIndicatorEnabled = *globalVal | ||
| } | ||
| } | ||
| if exitIndicatorEnabled { | ||
| indicator := wshrpc.TabIndicator{ | ||
| Icon: "spinner+spin", | ||
| Color: "#f59e0b", | ||
| Priority: 1.5, | ||
| ClearOnFocus: false, | ||
| } | ||
| eventData := wshrpc.TabIndicatorEventData{ | ||
| TabId: bc.TabId, | ||
| Indicator: &indicator, | ||
| } | ||
| event := wps.WaveEvent{ | ||
| Event: wps.Event_TabIndicator, | ||
| Scopes: []string{waveobj.MakeORef(waveobj.OType_Tab, bc.TabId).String()}, | ||
| Data: eventData, | ||
| } | ||
| wps.Broker.Publish(event) | ||
| } | ||
| } | ||
|
Comment on lines
+529
to
+555
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running indicator logic looks good. Global settings fallback is correctly implemented, and the indicator is appropriately scoped to One edge case: if the user disables Proposed fix+ // Always clear the running indicator for cmd blocks
+ if blockData.Meta.GetString(waveobj.MetaKey_Controller, "") == BlockController_Cmd {
+ clearEvent := wps.WaveEvent{
+ Event: wps.Event_TabIndicator,
+ Scopes: []string{waveobj.MakeORef(waveobj.OType_Tab, bc.TabId).String()},
+ Data: wshrpc.TabIndicatorEventData{TabId: bc.TabId, Indicator: nil},
+ }
+ wps.Broker.Publish(clearEvent)
+ }
if !exitIndicatorEnabled {
return
} |
||
|
|
||
| go func() { | ||
| // handles regular output from the pty (goes to the blockfile and xterm) | ||
| defer func() { | ||
|
|
@@ -616,6 +644,77 @@ func (bc *ShellController) manageRunningShellProcess(shellProc *shellexec.ShellP | |
| msg = fmt.Sprintf("%s (exit code %d)", baseMsg, exitCode) | ||
| } | ||
| bc.writeMutedMessageToTerminal("[" + msg + "]") | ||
| go func(exitCode int, exitSignal string) { | ||
| defer func() { | ||
| panichandler.PanicHandler("blockcontroller:exit-indicator", recover()) | ||
| }() | ||
| ctx, cancelFn := context.WithTimeout(context.Background(), DefaultTimeout) | ||
| defer cancelFn() | ||
| blockData, err := wstore.DBMustGet[*waveobj.Block](ctx, bc.BlockId) | ||
| if err != nil { | ||
| log.Printf("error getting block data for exit indicator: %v\n", err) | ||
| return | ||
| } | ||
| exitIndicatorEnabled := blockData.Meta.GetBool(waveobj.MetaKey_TermExitIndicator, false) | ||
| if !blockData.Meta.HasKey(waveobj.MetaKey_TermExitIndicator) { | ||
| if globalVal := wconfig.GetWatcher().GetFullConfig().Settings.TermExitIndicator; globalVal != nil { | ||
| exitIndicatorEnabled = *globalVal | ||
| } | ||
| } | ||
| if !exitIndicatorEnabled { | ||
| return | ||
| } | ||
| closeOnExit := blockData.Meta.GetBool(waveobj.MetaKey_CmdCloseOnExit, false) | ||
| closeOnExitForce := blockData.Meta.GetBool(waveobj.MetaKey_CmdCloseOnExitForce, false) | ||
| if closeOnExitForce || (closeOnExit && exitCode == 0) { | ||
| // Clear running indicator before block gets deleted | ||
| if bc.ControllerType == BlockController_Cmd { | ||
| clearEvent := wps.WaveEvent{ | ||
| Event: wps.Event_TabIndicator, | ||
| Scopes: []string{waveobj.MakeORef(waveobj.OType_Tab, bc.TabId).String()}, | ||
| Data: wshrpc.TabIndicatorEventData{TabId: bc.TabId, Indicator: nil}, | ||
| } | ||
| wps.Broker.Publish(clearEvent) | ||
| } | ||
| return | ||
| } | ||
| // Clear running indicator before exit indicator to prevent | ||
| // PersistentIndicator from resurrecting the amber glow | ||
| if bc.ControllerType == BlockController_Cmd { | ||
| clearEvent := wps.WaveEvent{ | ||
| Event: wps.Event_TabIndicator, | ||
| Scopes: []string{waveobj.MakeORef(waveobj.OType_Tab, bc.TabId).String()}, | ||
| Data: wshrpc.TabIndicatorEventData{TabId: bc.TabId, Indicator: nil}, | ||
| } | ||
| wps.Broker.Publish(clearEvent) | ||
| } | ||
| var indicator wshrpc.TabIndicator | ||
| if exitCode == 0 && exitSignal == "" { | ||
| indicator = wshrpc.TabIndicator{ | ||
| Icon: "check", | ||
| Color: "#4ade80", | ||
| Priority: 2, | ||
| ClearOnFocus: true, | ||
| } | ||
| } else { | ||
| indicator = wshrpc.TabIndicator{ | ||
| Icon: "xmark-large", | ||
| Color: "#f87171", | ||
| Priority: 2, | ||
| ClearOnFocus: true, | ||
| } | ||
| } | ||
| eventData := wshrpc.TabIndicatorEventData{ | ||
| TabId: bc.TabId, | ||
| Indicator: &indicator, | ||
| } | ||
| event := wps.WaveEvent{ | ||
| Event: wps.Event_TabIndicator, | ||
| Scopes: []string{waveobj.MakeORef(waveobj.OType_Tab, bc.TabId).String()}, | ||
| Data: eventData, | ||
| } | ||
| wps.Broker.Publish(event) | ||
| }(exitCode, exitSignal) | ||
| go checkCloseOnExit(bc.BlockId, exitCode) | ||
| }() | ||
| return nil | ||
|
|
||
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.
Rename keyframes to kebab-case to satisfy Stylelint.
indicatorBreathePhasetriggers thekeyframes-name-patternrule. Rename toindicator-breathe-phaseand update the reference on Line 13.Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 Stylelint (17.2.0)
[error] 16-16: Expected keyframe name "indicatorBreathePhase" to be kebab-case (keyframes-name-pattern)
(keyframes-name-pattern)
[error] 21-23: Expected empty line before rule (rule-empty-line-before)
(rule-empty-line-before)
🤖 Prompt for AI Agents