From 88e5f26dd81f8196a4cca4239cc2a5e2e87ddb69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Wed, 23 Oct 2024 20:16:30 +0200 Subject: [PATCH 1/5] not render snippets element if empty --- .../homebrew/editor/snippetbar/snippetbar.jsx | 1 + .../editor/snippetbar/snippetbar.less | 25 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 8e643a837..7800e1e52 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -150,6 +150,7 @@ const Snippetbar = createClass({ renderSnippetGroups : function(){ const snippets = this.state.snippets.filter((snippetGroup)=>snippetGroup.view === this.props.view); + if(snippets.length === 0) return null; return
{_.map(snippets, (snippetGroup)=>{ diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index a4d273bbf..2cdd1568c 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -7,7 +7,6 @@ display : flex; flex-wrap : wrap-reverse; justify-content : space-between; - min-width : 331px; height : auto; color : black; background-color : #DDDDDD; @@ -20,6 +19,10 @@ .editors { display : flex; justify-content : space-between; + + &:only-child { + margin-left:auto; + } >div { display : flex; flex : 1; @@ -218,9 +221,21 @@ } } } - +/*text tab*/ @container editor (width < 553px) { - .editors,.snippets { flex : 1; } - .editors { border-bottom : 1px solid;} - .snippetBar .editors > div.history > .dropdown { right : unset; } + /*This rule doesn't apply to properties editor or homepage*/ + .snippetBar:not(:has(>*:only-child)):has(.snippets >*:nth-child(3)) { + .editors,.snippets { flex : 1; } + .editors { border-bottom : 1px solid;} + .editors > div.history > .dropdown { right : unset; } + } +} +/*style tab*/ +@container editor (width < 328px) { + /*This rule doesn't apply to properties editor or homepage*/ + .snippetBar:not(:has(>*:only-child)) { + .editors,.snippets { flex : 1; } + .editors { border-bottom : 1px solid;} + .editors > div.history > .dropdown { right : unset; } + } } From 56c9413ab5c2f0c99e7634dd9e6321dfe1b7dab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Thu, 24 Oct 2024 01:04:22 +0200 Subject: [PATCH 2/5] next iteration --- .../homebrew/editor/snippetbar/snippetbar.jsx | 2 +- .../editor/snippetbar/snippetbar.less | 19 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 7800e1e52..7f5e5dc71 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -208,7 +208,7 @@ const Snippetbar = createClass({ if(!this.props.showEditButtons) return; let foldButtons; - if(this.props.view == 'text'){ + if(this.props.view !== 'meta'){ foldButtons = <>
*:only-child)):has(.snippets >*:nth-child(3)) { - .editors,.snippets { flex : 1; } - .editors { border-bottom : 1px solid;} - .editors > div.history > .dropdown { right : unset; } - } -} -/*style tab*/ -@container editor (width < 328px) { /*This rule doesn't apply to properties editor or homepage*/ .snippetBar:not(:has(>*:only-child)) { - .editors,.snippets { flex : 1; } + .editors { flex:1;justify-content : space-between;} + .snippets { flex:1;justify-content : space-evenly; } .editors { border-bottom : 1px solid;} .editors > div.history > .dropdown { right : unset; } } } + From 70046e00f89af966d60681267606bb476d9be3e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Thu, 24 Oct 2024 01:07:52 +0200 Subject: [PATCH 3/5] fix min-width in meta tab --- client/homebrew/editor/snippetbar/snippetbar.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 55c9483ef..34dcf20be 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -23,8 +23,10 @@ min-width:225px; &:only-child { + min-width: none; margin-left:auto; } + >div { display : flex; flex : 1; From 5b675918ad39d94243ca329c425e05eb9f7ab7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Thu, 24 Oct 2024 01:10:47 +0200 Subject: [PATCH 4/5] real fix for the meta tab --- client/homebrew/editor/snippetbar/snippetbar.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 34dcf20be..79a51c7dd 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -23,10 +23,10 @@ min-width:225px; &:only-child { - min-width: none; + min-width: unset; margin-left:auto; } - + >div { display : flex; flex : 1; From 55a50ce2612758bd82b61cfaed880d7844172969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Thu, 24 Oct 2024 01:23:26 +0200 Subject: [PATCH 5/5] always stretch --- .../homebrew/editor/snippetbar/snippetbar.jsx | 25 ++++++--------- .../editor/snippetbar/snippetbar.less | 31 ++++++++++--------- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 7f5e5dc71..50237b914 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -207,21 +207,16 @@ const Snippetbar = createClass({ renderEditorButtons : function(){ if(!this.props.showEditButtons) return; - let foldButtons; - if(this.props.view !== 'meta'){ - foldButtons = - <> -
- -
-
- -
- ; - - } + const foldButtons = <> +
+ +
+
+ +
+ ; return
diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 79a51c7dd..319cd0cad 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -14,18 +14,15 @@ .snippets { display : flex; justify-content : flex-start; - min-width:327.58px; + min-width : 327.58px; } .editors { display : flex; justify-content : flex-end; - min-width:225px; + min-width : 225px; - &:only-child { - min-width: unset; - margin-left:auto; - } + &:only-child { margin-left : auto; } >div { display : flex; @@ -66,12 +63,14 @@ &.foldAll { .tooltipLeft('Fold All'); font-size : 0.75em; - color : inherit; + color : grey; + &.active { color : inherit; } } &.unfoldAll { .tooltipLeft('Unfold All'); font-size : 0.75em; - color : inherit; + color : grey; + &.active { color : inherit; } } &.history { .tooltipLeft('History'); @@ -225,13 +224,17 @@ } } } -/*text tab*/ @container editor (width < 553px) { - /*This rule doesn't apply to properties editor or homepage*/ - .snippetBar:not(:has(>*:only-child)) { - .editors { flex:1;justify-content : space-between;} - .snippets { flex:1;justify-content : space-evenly; } - .editors { border-bottom : 1px solid;} + .snippetBar { + .editors { + flex : 1; + justify-content : space-between; + border-bottom : 1px solid; + } + .snippets { + flex : 1; + justify-content : space-evenly; + } .editors > div.history > .dropdown { right : unset; } } }