Skip to content

Commit 2178b60

Browse files
committed
Minor Doc viewer updates
- Remove styling overrides (not legible in dark mode + generally simplify) - Single click expand
1 parent a125f24 commit 2178b60

2 files changed

Lines changed: 27 additions & 49 deletions

File tree

client-app/src/desktop/tabs/docs/DocsPanelModel.ts

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {GridModel} from '@xh/hoist/cmp/grid';
2-
import {span} from '@xh/hoist/cmp/layout';
32
import {Content, HoistModel, managed, TaskObserver, XH} from '@xh/hoist/core';
43
import {DockContainerModel} from '@xh/hoist/desktop/cmp/dock';
54
import {PanelModel} from '@xh/hoist/desktop/cmp/panel';
@@ -124,11 +123,14 @@ export class DocsPanelModel extends HoistModel {
124123
return this.docService.getDocsByCategory(this.activeDoc.source, this.activeDoc.category);
125124
}
126125

127-
/** Categories for the active doc's source. */
126+
/** Categories for the active doc's source, filtered to those with at least one doc. */
128127
@computed
129128
get activeSourceCategories(): DocCategory[] {
130129
if (!this.activeDoc) return [];
131-
return this.docService.getCategories(this.activeDoc.source);
130+
const {source} = this.activeDoc;
131+
return this.docService
132+
.getCategories(source)
133+
.filter(cat => this.docService.getDocsByCategory(source, cat.id).length > 0);
132134
}
133135

134136
/** H2-level sections parsed from the current document content. */
@@ -308,6 +310,7 @@ export class DocsPanelModel extends HoistModel {
308310
return new GridModel({
309311
selModel: 'single',
310312
treeMode: true,
313+
clicksToExpand: 1,
311314
showHover: true,
312315
expandLevel: 1,
313316
store: {
@@ -327,12 +330,7 @@ export class DocsPanelModel extends HoistModel {
327330
{
328331
field: 'title',
329332
flex: 1,
330-
isTreeColumn: true,
331-
renderer: (v, {record}) => {
332-
return record.data.isSource
333-
? span({style: {color: 'var(--xh-black)'}, item: v})
334-
: v;
335-
}
333+
isTreeColumn: true
336334
},
337335
{
338336
field: 'order',
@@ -484,40 +482,36 @@ export class DocsPanelModel extends HoistModel {
484482

485483
getCategoryIcon(categoryId: string) {
486484
switch (categoryId) {
487-
// hoist-react categories
488-
case 'overview':
489-
return Icon.home();
490-
case 'core':
491-
return Icon.gear();
485+
case 'app-development':
486+
return Icon.code();
492487
case 'components':
493488
return Icon.gridPanel();
489+
case 'concepts':
490+
return Icon.book();
491+
case 'core':
492+
return Icon.gear();
493+
case 'core-features':
494+
return Icon.boxFull();
495+
case 'core-framework':
496+
return Icon.gear();
494497
case 'desktop':
495498
return Icon.desktop();
499+
case 'devops':
500+
return Icon.server();
501+
case 'grails-platform':
502+
return Icon.database();
503+
case 'infrastructure':
504+
return Icon.server();
496505
case 'mobile':
497506
return Icon.mobile();
498-
case 'utilities':
499-
return Icon.wrench();
500-
case 'concepts':
501-
return Icon.book();
507+
case 'overview':
508+
return Icon.home();
502509
case 'supporting':
503510
return Icon.cube();
504-
case 'devops':
505-
return Icon.server();
506511
case 'upgrade':
507512
return Icon.arrowUp();
508-
// hoist-core categories
509-
case 'core-framework':
510-
return Icon.gear();
511-
case 'core-features':
512-
return Icon.gears();
513-
case 'infrastructure':
514-
return Icon.server();
515-
case 'app-development':
516-
return Icon.code();
517-
case 'grails-platform':
518-
return Icon.database();
519-
case 'build':
520-
return Icon.boxFull();
513+
case 'utilities':
514+
return Icon.wrench();
521515
default:
522516
return Icon.folder();
523517
}

client-app/src/desktop/tabs/docs/DocsTab.scss

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,10 @@
2121
// Style group rows (source + category levels)
2222
.ag-row-group {
2323
font-weight: 600;
24-
color: var(--xh-text-color-muted);
2524
text-transform: uppercase;
2625
font-size: 11px;
2726
letter-spacing: 0.5px;
2827
}
29-
30-
// Source-level rows: slightly larger styling
31-
.ag-row-level-0 {
32-
font-size: 12px;
33-
letter-spacing: 0.4px;
34-
}
3528
}
3629
}
3730

@@ -46,14 +39,6 @@
4639
align-items: center;
4740
gap: 2px;
4841

49-
&-source {
50-
font-weight: 600;
51-
color: var(--xh-text-color-muted);
52-
font-size: 12px;
53-
text-transform: uppercase;
54-
letter-spacing: 0.3px;
55-
}
56-
5742
&-btn {
5843
font-weight: 500;
5944
border-bottom: 1px dashed var(--xh-border-color);
@@ -124,7 +109,6 @@
124109
}
125110

126111
&-desc {
127-
//font-size: var(--xh-font-size-small-px);
128112
color: var(--xh-text-color-muted);
129113
margin-top: 4px;
130114
line-height: 1.4;

0 commit comments

Comments
 (0)