Skip to content

Commit

Permalink
registerPanelTabAction.InsertAtIndexZero
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthetus committed Sep 4, 2023
1 parent a91655e commit 0ae6241
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public partial record PanelsCollection
public record RegisterPanelRecordAction(PanelRecord PanelRecord);
public record DisposePanelRecordAction(PanelRecordKey PanelRecordKey);

public record RegisterPanelTabAction(PanelRecordKey PanelRecordKey, PanelTab PanelTab);
public record RegisterPanelTabAction(PanelRecordKey PanelRecordKey, PanelTab PanelTab, bool InsertAtIndexZero);
public record DisposePanelTabAction(PanelRecordKey PanelRecordKey, PanelTabKey PanelTabKey);

public record SetActivePanelTabAction(PanelRecordKey PanelRecordKey, PanelTabKey PanelTabKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,19 @@ public static PanelsCollection ReduceRegisterPanelTabAction(
if (targetedPanelRecord is null)
return previousPanelsCollection;

var nextPanelTabs = targetedPanelRecord.PanelTabs.Add(
registerPanelTabAction.PanelTab);
var nextPanelTabs = targetedPanelRecord.PanelTabs;

if (registerPanelTabAction.InsertAtIndexZero)
{
nextPanelTabs = targetedPanelRecord.PanelTabs.Insert(
0,
registerPanelTabAction.PanelTab);
}
else
{
nextPanelTabs = targetedPanelRecord.PanelTabs.Add(
registerPanelTabAction.PanelTab);
}

var nextPanelRecord = targetedPanelRecord with
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="luth_ide_background-services">
<div class="luth_ide_section-title">
Background Tasks
</div>

<div class="luth_ide_section-body">
<BackgroundServiceDisplay BackgroundTaskQueue="LuthetusCommonBackgroundTaskService" />
<BackgroundServiceDisplay BackgroundTaskQueue="LuthetusIdeFileSystemBackgroundTaskService" />
<BackgroundServiceDisplay BackgroundTaskQueue="LuthetusIdeTerminalBackgroundTaskService" />
<BackgroundServiceDisplay BackgroundTaskQueue="LuthetusTextEditorCompilerServiceBackgroundTaskService" />
<BackgroundServiceDisplay BackgroundTaskQueue="LuthetusTextEditorTextEditorBackgroundTaskService" />
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Luthetus.Ide.RazorLib.BackgroundServiceCase;

public partial class BackgroundServicesPanelDisplay : ComponentBase
public partial class BackgroundServicesDisplay : ComponentBase
{
[Inject]
private ILuthetusCommonBackgroundTaskService LuthetusCommonBackgroundTaskService { get; set; } = null!;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.luth_ide_background-services {
height: 100%;
}

This file was deleted.

22 changes: 14 additions & 8 deletions Source/Lib/Luthetus.Ide.RazorLib/LuthetusIdeInitializer.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ private void InitializeLeftPanelTabs()

Dispatcher.Dispatch(new PanelsCollection.RegisterPanelTabAction(
leftPanel.PanelRecordKey,
solutionExplorerPanelTab));
solutionExplorerPanelTab,
false));

var folderExplorerPanelTab = new PanelTab(
PanelTabKey.NewPanelTabKey(),
Expand All @@ -124,7 +125,8 @@ private void InitializeLeftPanelTabs()

Dispatcher.Dispatch(new PanelsCollection.RegisterPanelTabAction(
leftPanel.PanelRecordKey,
folderExplorerPanelTab));
folderExplorerPanelTab,
false));

Dispatcher.Dispatch(new PanelsCollection.SetActivePanelTabAction(
leftPanel.PanelRecordKey,
Expand All @@ -139,25 +141,27 @@ private void InitializeRightPanelTabs()
PanelTabKey.NewPanelTabKey(),
rightPanel.ElementDimensions,
new(),
typeof(NotificationHistoryDisplay),
typeof(NotificationsDisplay),
typeof(IconFolder),
"Notifications");

Dispatcher.Dispatch(new PanelsCollection.RegisterPanelTabAction(
rightPanel.PanelRecordKey,
notificationsPanelTab));
notificationsPanelTab,
false));

var backgroundServicesPanelTab = new PanelTab(
PanelTabKey.NewPanelTabKey(),
rightPanel.ElementDimensions,
new(),
typeof(BackgroundServicesPanelDisplay),
typeof(BackgroundServicesDisplay),
typeof(IconFolder),
"Background Tasks");

Dispatcher.Dispatch(new PanelsCollection.RegisterPanelTabAction(
rightPanel.PanelRecordKey,
backgroundServicesPanelTab));
backgroundServicesPanelTab,
false));
}

private void InitializeBottomPanelTabs()
Expand All @@ -174,7 +178,8 @@ private void InitializeBottomPanelTabs()

Dispatcher.Dispatch(new PanelsCollection.RegisterPanelTabAction(
bottomPanel.PanelRecordKey,
terminalPanelTab));
terminalPanelTab,
false));

var nuGetPanelTab = new PanelTab(
PanelTabKey.NewPanelTabKey(),
Expand All @@ -186,7 +191,8 @@ private void InitializeBottomPanelTabs()

Dispatcher.Dispatch(new PanelsCollection.RegisterPanelTabAction(
bottomPanel.PanelRecordKey,
nuGetPanelTab));
nuGetPanelTab,
false));

Dispatcher.Dispatch(new PanelsCollection.SetActivePanelTabAction(
bottomPanel.PanelRecordKey,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="luth_ide_folder-notifications">
<div class="luth_ide_section-title">
Notifications
</div>

<div class="luth_ide_section-body">
#TODO: Body
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Luthetus.Ide.RazorLib.Notification;

public partial class NotificationHistoryDisplay : ComponentBase
public partial class NotificationsDisplay : ComponentBase
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.luth_ide_folder-notifications {
height: 100%;
}
6 changes: 4 additions & 2 deletions Source/Lib/Luthetus.Ide.RazorLib/Panel/PanelDisplay.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ private Task TopDropzoneOnMouseUp(MouseEventArgs mouseEventArgs)

Dispatcher.Dispatch(new PanelsCollection.RegisterPanelTabAction(
panelRecord.PanelRecordKey,
panelDragEventArgs.Value.TagDragTarget));
panelDragEventArgs.Value.TagDragTarget,
true));
}

return Task.CompletedTask;
Expand All @@ -168,7 +169,8 @@ private Task BottomDropzoneOnMouseUp(MouseEventArgs mouseEventArgs)

Dispatcher.Dispatch(new PanelsCollection.RegisterPanelTabAction(
panelRecord.PanelRecordKey,
panelDragEventArgs.Value.TagDragTarget));
panelDragEventArgs.Value.TagDragTarget,
false));
}

return Task.CompletedTask;
Expand Down
11 changes: 10 additions & 1 deletion Source/Lib/Luthetus.Ide.RazorLib/Panel/PanelTabDisplay.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
@PanelTab.DisplayName
</span>

@*
<!--
Commenting out this code. The idea was to track the index of the panel tab
which was being hovered over. Then one can insert the panel tab they are
dragging either before or after that index.
(2023-09-03)
-->
@if (PanelsCollectionWrap.Value.PanelDragEventArgs is not null)
{
<div class="luth_ide_panel-tab-dropzone luth_ide_panel-tab-dropzone-top"
Expand All @@ -20,7 +29,7 @@
@onmouseup:stopPropagation="true"
@onmouseup="BottomDropzoneOnMouseUp">
</div>
}
} *@
</button>

@if (PanelTab.IsBeingDragged)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ private Task TopDropzoneOnMouseUp(MouseEventArgs mouseEventArgs)

Dispatcher.Dispatch(new PanelsCollection.RegisterPanelTabAction(
PanelRecord.PanelRecordKey,
panelDragEventArgs.Value.TagDragTarget));
panelDragEventArgs.Value.TagDragTarget,
false));
}

return Task.CompletedTask;
Expand All @@ -145,7 +146,8 @@ private Task BottomDropzoneOnMouseUp(MouseEventArgs mouseEventArgs)

Dispatcher.Dispatch(new PanelsCollection.RegisterPanelTabAction(
PanelRecord.PanelRecordKey,
panelDragEventArgs.Value.TagDragTarget));
panelDragEventArgs.Value.TagDragTarget,
false));
}

return Task.CompletedTask;
Expand Down
14 changes: 8 additions & 6 deletions Source/Lib/Luthetus.Ide.RazorLib/wwwroot/luthetusIde.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ input[type="checkbox"]{
}

.luth_ide_footer {
background-color: var(--luth_ide_footer-background-color);
background-color: var(--luth_ide_body-background-color);
}

.luth_ide_section-title {
Expand Down Expand Up @@ -310,6 +310,7 @@ button.luth_ide_input-file-address-hierarchy-entry {

.luth_ide_panel-tabs {
position: relative;
background-color: var(--luth_ide_footer-background-color);
}

.luth_ide_panel-tab {
Expand All @@ -326,20 +327,21 @@ button.luth_ide_input-file-address-hierarchy-entry {
position: absolute;
left: 0;
z-index: 100;
background-color: var(--luth_primary-hover-background-color);
opacity: 0.6;
}

.luth_ide_panel-tab-dropzone:hover {
background-color: orange;
}
.luth_ide_panel-tab-dropzone:hover {
background-color: var(--luth_button-hover-background-color);
box-shadow: 0 0 2px var(--luth_primary-overlay-box-shadow-color);
}

.luth_ide_panel-tab-dropzone-top {
top: 0;
background-color: aqua;
}

.luth_ide_panel-tab-dropzone-bottom {
top: 50%;
background-color: mediumpurple;
}

.luth_ide_panel-tab-drag-display {
Expand Down

0 comments on commit 0ae6241

Please sign in to comment.