MainView UI updates (history, connections, settings, bookmarks) (#339)

* slight tab update

* sidebar separator / hightlight color restored

* fix mainviews, lots of history view fixes

* more mainview changes.  update for bottom-border, fix bookmarks
This commit is contained in:
Mike Sawka 2024-02-26 15:28:59 -08:00 committed by GitHub
parent 01e4106aa7
commit b120a7952d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 252 additions and 302 deletions

View File

@ -240,21 +240,6 @@ a.a-block {
flex-direction: row; flex-direction: row;
height: 100%; height: 100%;
position: relative; position: relative;
.history-view,
.bookmarks-view,
.plugins-view,
.connections-view {
flex-grow: 1;
display: flex;
flex-direction: column;
margin-right: 0.5em;
position: relative;
&.is-hidden {
display: none;
}
overflow: auto;
}
} }
} }
@ -649,27 +634,39 @@ a.a-block {
} }
} }
.view { .mainview {
background-color: var(--session-bg-color);
flex-grow: 1; flex-grow: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
overflow: auto; border-radius: 0 var(--app-border-radius) var(--app-border-radius) var(--app-border-radius);
margin-bottom: 10px; border-bottom: 1px solid var(--app-border-color);
margin-right: 10px; border-right: 1px solid var(--app-border-color);
border-radius: 8px; border-left: 1px solid var(--app-border-color);
border: 1px solid rgba(241, 246, 243, 0.08); background-color: black;
&.is-hidden {
display: none;
}
.header { .header {
margin: 24px 18px; -webkit-app-region: drag;
padding: 24px 18px;
margin: 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.close-div { .close-div {
-webkit-app-region: no-drag;
font-size: 1.5em; font-size: 1.5em;
} }
&.bottom-border {
border-bottom: 1px solid white;
padding-bottom: 20px;
margin-bottom: 20px;
}
} }
} }

View File

@ -1,31 +1,4 @@
.bookmarks-view { .bookmarks-view {
background-color: var(--session-bg-color);
.close-button {
position: absolute;
right: 1em;
top: 0.8em;
cursor: pointer;
width: 1.5em;
height: 1.5em;
border-radius: 50%;
svg {
width: 1.5em;
height: 1.5em;
fill: var(--app-text-color);
}
}
.header {
margin: 1.5em 1.5em 0.5em;
.bookmarks-title {
margin-bottom: 0.5em;
font-weight: bold;
font-size: 1.5em;
}
}
.icon { .icon {
width: 1em; width: 1em;
height: 1em; height: 1em;

View File

@ -10,7 +10,6 @@ import cn from "classnames";
import { GlobalModel } from "@/models"; import { GlobalModel } from "@/models";
import { CmdStrCode, Markdown } from "@/common/elements"; import { CmdStrCode, Markdown } from "@/common/elements";
import { ReactComponent as XmarkIcon } from "@/assets/icons/line/xmark.svg";
import { ReactComponent as CopyIcon } from "@/assets/icons/favourites/copy.svg"; import { ReactComponent as CopyIcon } from "@/assets/icons/favourites/copy.svg";
import { ReactComponent as PenIcon } from "@/assets/icons/favourites/pen.svg"; import { ReactComponent as PenIcon } from "@/assets/icons/favourites/pen.svg";
import { ReactComponent as TrashIcon } from "@/assets/icons/favourites/trash.svg"; import { ReactComponent as TrashIcon } from "@/assets/icons/favourites/trash.svg";
@ -204,11 +203,11 @@ class BookmarksView extends React.Component<{}, {}> {
let idx: number = 0; let idx: number = 0;
let bookmark: BookmarkType = null; let bookmark: BookmarkType = null;
return ( return (
<div className={cn("bookmarks-view", { "is-hidden": isHidden })}> <div className={cn("mainview", "bookmarks-view", { "is-hidden": isHidden })}>
<div className="header"> <div className="header bottom-border">
<div className="bookmarks-title">Favorites</div> <div className="bookmarks-title text-primary">Favorites</div>
<div className="close-button hoverEffect" title="Close (Escape)" onClick={this.closeView}> <div className="close-div hoverEffect" title="Close (Escape)" onClick={this.closeView}>
<XmarkIcon className={"icon"} /> <i className="fa-sharp fa-solid fa-xmark"></i>
</div> </div>
</div> </div>
<div className="bookmarks-list"> <div className="bookmarks-list">

View File

@ -1,27 +1,6 @@
@import "@/common/themes/themes.less"; @import "@/common/themes/themes.less";
.clientsettings-view { .clientsettings-view {
background-color: var(--session-bg-color);
flex-grow: 1;
display: flex;
flex-direction: column;
position: relative;
overflow: auto;
margin-bottom: 10px;
margin-right: 10px;
border-radius: 8px;
border: 1px solid rgba(241, 246, 243, 0.08);
background: rgba(13, 13, 13, 0.85);
.header {
margin: 24px 18px;
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 20px;
border-bottom: 1px solid white;
}
.content { .content {
padding: 0 18px 0 30px; padding: 0 18px 0 30px;
} }

View File

@ -148,8 +148,8 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
const curFontFamily = GlobalModel.getTermFontFamily(); const curFontFamily = GlobalModel.getTermFontFamily();
return ( return (
<div className={cn("view clientsettings-view")}> <div className={cn("mainview", "clientsettings-view")}>
<header className="header"> <header className="header bottom-border">
<div className="clientsettings-title text-primary">Client Settings</div> <div className="clientsettings-title text-primary">Client Settings</div>
<div className="close-div hoverEffect" title="Close (Escape)" onClick={this.handleClose}> <div className="close-div hoverEffect" title="Close (Escape)" onClick={this.handleClose}>
<i className="fa-sharp fa-solid fa-xmark"></i> <i className="fa-sharp fa-solid fa-xmark"></i>

View File

@ -130,8 +130,8 @@ class ConnectionsView extends React.Component<{ model: RemotesModel }, { hovered
let item: RemoteType = null; let item: RemoteType = null;
return ( return (
<div className={cn("view connections-view")}> <div className={cn("mainview", "connections-view")}>
<header className="header"> <header className="header bottom-border">
<div className="connections-title text-primary">Connections</div> <div className="connections-title text-primary">Connections</div>
<div className="close-div hoverEffect" title="Close (Escape)" onClick={this.handleClose}> <div className="close-div hoverEffect" title="Close (Escape)" onClick={this.handleClose}>
<i className="fa-sharp fa-solid fa-xmark"></i> <i className="fa-sharp fa-solid fa-xmark"></i>

View File

@ -1,11 +1,16 @@
@import "@/common/themes/themes.less"; @import "@/common/themes/themes.less";
.history-view { .history-view {
background-color: var(--session-bg-color); padding-bottom: 10px;
.header {
padding: 18px 18px;
}
.icon { .icon {
width: 1.3em !important; width: 2em !important;
height: 1.3em !important; height: 1.3em !important;
padding-left: 5px;
fill: var(--app-text-color); fill: var(--app-text-color);
} }
@ -55,19 +60,18 @@
} }
} }
.header {
margin: 1.5em 1.5em 0.5em;
.history-title {
margin-bottom: 0.5em;
font-weight: bold;
font-size: 1.5em;
}
}
.history-search { .history-search {
flex-grow: 1; flex-grow: 1;
margin-top: 5px; padding: 0 10px 10px 10px;
input {
border: none;
border-radius: 4px;
font-size: 1em;
padding: 0.5em 1em;
background-color: @background-session-components;
color: @base-color;
}
.main-search { .main-search {
.field { .field {
@ -169,6 +173,7 @@
margin-left: 10px; margin-left: 10px;
align-items: center; align-items: center;
height: 32px; height: 32px;
flex-shrink: 0;
.is-hidden { .is-hidden {
display: none; display: none;
@ -251,6 +256,12 @@
margin: 20px 50px 20px 20px; margin: 20px 50px 20px 20px;
} }
.history-scroll-region {
flex-grow: 1;
min-height: 200px;
overflow-y: auto;
}
.history-table { .history-table {
margin: 0px 10px 10px 10px; margin: 0px 10px 10px 10px;
table-layout: fixed; table-layout: fixed;

View File

@ -424,14 +424,19 @@ class HistoryView extends React.Component<{}, {}> {
const width = window.innerWidth - 6 - GlobalModel.mainSidebarModel.getWidth(); const width = window.innerWidth - 6 - GlobalModel.mainSidebarModel.getWidth();
return ( return (
<div <div
className={cn("history-view", "view", { "is-hidden": isHidden })} className={cn("history-view", "mainview", { "is-hidden": isHidden })}
style={{ style={{
width: `${width}px`, width: `${width}px`,
}} }}
> >
<div className="header"> <header key="header" className="header">
<div className="history-title">History</div> <div className="clientsettings-title text-primary">History</div>
<div className="history-search"> <div className="close-div hoverEffect" title="Close (Escape)" onClick={this.clickCloseHandler}>
<i className="fa-sharp fa-solid fa-xmark"></i>
</div>
</header>
<div key="search" className="history-search">
<div className="main-search field"> <div className="main-search field">
<TextField <TextField
placeholder="Exact String Search" placeholder="Exact String Search"
@ -539,11 +544,7 @@ class HistoryView extends React.Component<{}, {}> {
</div> </div>
</div> </div>
</div> </div>
<div className="close-div hoverEffect" title="Close (Escape)" onClick={this.clickCloseHandler}> <div key="control1" className={cn("control-bar", "is-top", { "is-hidden": items.length == 0 })}>
<XmarkIcon />
</div>
</div>
<div className={cn("control-bar", "is-top", { "is-hidden": items.length == 0 })}>
<div className="control-checkbox" onClick={this.handleControlCheckbox} title="Toggle Selection"> <div className="control-checkbox" onClick={this.handleControlCheckbox} title="Toggle Selection">
<HistoryCheckbox <HistoryCheckbox
checked={numSelected > 0 && numSelected == items.length} checked={numSelected > 0 && numSelected == items.length}
@ -581,12 +582,20 @@ class HistoryView extends React.Component<{}, {}> {
<ChevronRightIcon className="icon" /> <ChevronRightIcon className="icon" />
</div> </div>
</div> </div>
<If condition={items.length == 0}>
<div key="no-items" className="no-items">
<div>No History Items Found</div>
</div>
</If>
<div key="hsr" className="history-scroll-region">
<table className="history-table" cellSpacing="0" cellPadding="0" border={0} ref={this.tableRef}> <table className="history-table" cellSpacing="0" cellPadding="0" border={0} ref={this.tableRef}>
<tbody> <tbody>
<For index="idx" each="item" of={items}> <For index="idx" each="item" of={items}>
<tr <tr
key={item.historyid} key={item.historyid}
className={cn("history-item", { "is-selected": hvm.selectedItems.get(item.historyid) })} className={cn("history-item", {
"is-selected": hvm.selectedItems.get(item.historyid),
})}
> >
<td className="selectbox" onClick={() => this.handleSelect(item.historyid)}> <td className="selectbox" onClick={() => this.handleSelect(item.historyid)}>
<HistoryCheckbox checked={hvm.selectedItems.get(item.historyid)} /> <HistoryCheckbox checked={hvm.selectedItems.get(item.historyid)} />
@ -649,7 +658,8 @@ class HistoryView extends React.Component<{}, {}> {
</For> </For>
</tbody> </tbody>
</table> </table>
<div className={cn("control-bar", { "is-hidden": items.length == 0 || !hasMore })}> </div>
<div key="control2" className={cn("control-bar", { "is-hidden": items.length == 0 || !hasMore })}>
<div className="spacer" /> <div className="spacer" />
<div className="showing-text"> <div className="showing-text">
Showing {offset + 1}-{offset + items.length} Showing {offset + 1}-{offset + items.length}
@ -668,14 +678,6 @@ class HistoryView extends React.Component<{}, {}> {
<ChevronRightIcon className="icon" /> <ChevronRightIcon className="icon" />
</div> </div>
</div> </div>
<If condition={items.length == 0}>
<div className="no-items">
<div>No History Items Found</div>
</div>
</If>
<div className="alt-help">
<div className="help-entry">[Esc] to Close</div>
</div>
</div> </div>
); );
} }

View File

@ -125,6 +125,8 @@
// sidebar colors // sidebar colors
--sidebar-dev-bg-color: rgb(21, 23, 48); --sidebar-dev-bg-color: rgb(21, 23, 48);
--sidebar-settings-color: rgb(255, 255, 255); --sidebar-settings-color: rgb(255, 255, 255);
--sidebar-separator-color: var(--app-border-color);
--sidebar-highlight-color: rgba(241, 246, 243, 0.08);
// line colors // line colors
--line-sidebar-message-color: rgb(196, 160, 0); --line-sidebar-message-color: rgb(196, 160, 0);

View File

@ -16,7 +16,7 @@
.title-bar-drag { .title-bar-drag {
-webkit-app-region: drag; -webkit-app-region: drag;
height: 20px; height: 30px;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -126,9 +126,7 @@
border-bottom: 1px solid var(--sidebar-separator-color); border-bottom: 1px solid var(--sidebar-separator-color);
.item { .item {
&.active { &.active {
background: var(--sidebar-separator-color); background-color: var(--sidebar-highlight-color);
box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.4), 0px 0px 0.5px 0px rgba(0, 0, 0, 0.5),
0px 0px 0.5px 0px rgba(255, 255, 255, 0.5) inset, 0px 0.5px 0px 0px rgba(255, 255, 255, 0.2) inset;
} }
.index { .index {
font-size: 10px; font-size: 10px;

View File

@ -250,12 +250,11 @@
.screen-tab { .screen-tab {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
height: 3em;
min-width: 13.6em; min-width: 13.6em;
max-width: 13.6em; max-width: 13.6em;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
padding: 0 8px 0 8px; padding: 8px 8px 4px 8px; // extra 4px of tab padding to account for horizontal scrollbar (to make tab text look centered)
.front-icon { .front-icon {
.positional-icon-visible; .positional-icon-visible;
@ -306,7 +305,7 @@
cursor: pointer; cursor: pointer;
display: flex; display: flex;
align-items: center; align-items: center;
height: 37px; height: 100%;
.icon { .icon {
height: 2rem; height: 2rem;
@ -318,7 +317,8 @@
.tabs-end-spacer { .tabs-end-spacer {
flex-grow: 1; flex-grow: 1;
min-width: 20px; min-width: 30px;
-webkit-app-region: drag; -webkit-app-region: drag;
height: 100%;
} }
} }

View File

@ -1,18 +1,7 @@
@import "@/common/themes/themes.less"; @import "@/common/themes/themes.less";
.session-view { .session-view {
flex-grow: 1; overflow: hidden;
display: flex;
flex-direction: column;
position: relative;
&.is-hidden {
display: none;
}
border-radius: 0 var(--app-border-radius) var(--app-border-radius) var(--app-border-radius);
border-bottom: 1px solid var(--app-border-color);
border-right: 1px solid var(--app-border-color);
border-left: 1px solid var(--app-border-color);
background-color: black;
.center-message { .center-message {
display: flex; display: flex;

View File

@ -45,7 +45,7 @@ class WorkspaceView extends React.Component<{}, {}> {
return ( return (
<div <div
className={cn("session-view", { "is-hidden": isHidden })} className={cn("mainview", "session-view", { "is-hidden": isHidden })}
data-sessionid={session.sessionId} data-sessionid={session.sessionId}
style={{ style={{
width: `${width}px`, width: `${width}px`,