From 0449497a1199552c41538eff3ffc84d9322f9822 Mon Sep 17 00:00:00 2001 From: Philipp Schaad Date: Thu, 29 Jun 2023 13:40:32 +0200 Subject: [PATCH] Minimap and info tray improvements (#222) --- media/components/sdfv/index.html | 4 +- packages/sdfv | 2 +- src/components/sdfg_editor/common.ts | 4 +- .../components/sdfv/utils/attributes_table.ts | 173 ++++++++++++++++-- .../components/sdfv/vscode_sdfv.css | 9 +- src/webclients/components/sdfv/vscode_sdfv.ts | 94 ++++++++-- 6 files changed, 245 insertions(+), 41 deletions(-) diff --git a/media/components/sdfv/index.html b/media/components/sdfv/index.html index 4404432..7c65efd 100644 --- a/media/components/sdfv/index.html +++ b/media/components/sdfv/index.html @@ -164,8 +164,8 @@ -
- menu_open +
+ right_panel_open
diff --git a/packages/sdfv b/packages/sdfv index 6daba21..248a55c 160000 --- a/packages/sdfv +++ b/packages/sdfv @@ -1 +1 @@ -Subproject commit 6daba2113c3b1886fc3c9b73ea49d33e01be1350 +Subproject commit 248a55c8ab43f7f0e431c045fbfd50579a9da3ae diff --git a/src/components/sdfg_editor/common.ts b/src/components/sdfg_editor/common.ts index e91ae1f..fe75d32 100644 --- a/src/components/sdfg_editor/common.ts +++ b/src/components/sdfg_editor/common.ts @@ -107,8 +107,8 @@ export abstract class SDFGEditorBase extends BaseComponent { 'offcanvas offcanvas-bottom' ); baseHtml = baseHtml.replace( - 'expand-info-btn-top', - 'expand-info-btn-bottom' + 'right_panel_open', + 'bottom_panel_open' ); baseHtml = baseHtml.replace( 'id="layout-toggle-btn" class="vertical"', diff --git a/src/webclients/components/sdfv/utils/attributes_table.ts b/src/webclients/components/sdfv/utils/attributes_table.ts index a186f80..b137949 100644 --- a/src/webclients/components/sdfv/utils/attributes_table.ts +++ b/src/webclients/components/sdfv/utils/attributes_table.ts @@ -1130,6 +1130,25 @@ export async function attributeTablePutEntry( }; } + +const ATTR_TABLE_HIDDEN_ATTRIBUTES = [ + 'layout', + 'sdfg', + 'sdfg_id', + 'state_id', + 'expr_index', + 'type', + 'transformation', + 'docstring', + 'CATEGORY', + 'is_collapsed', + 'orig_sdfg', + 'position', + 'transformation_hist', + 'symbols', +]; + + export function generateAttributesTable( elem: any | undefined, xform: any | undefined, root: JQuery ): void { @@ -1166,12 +1185,7 @@ export function generateAttributesTable( let sortedAttributes: { [key: string]: any } = {}; Object.keys(attributes).forEach(k => { const val = attributes[k]; - if (k === 'layout' || k === 'sdfg' || k === 'sdfg_id' || - k === 'state_id' || k === 'expr_index' || k === 'type' || - k === 'transformation' || k === 'docstring' || - k === 'CATEGORY' || k === 'is_collapsed' || k === 'orig_sdfg' || - k === 'position' || k === 'transformation_hist' || - k.startsWith('_')) + if (ATTR_TABLE_HIDDEN_ATTRIBUTES.includes(k) || k.startsWith('_')) return; if (metadata && metadata[k]) { @@ -1320,6 +1334,133 @@ export function generateAttributesTable( } } +export function appendSymbolsTable( + root: JQuery, symbols: Record, sdfg: JsonSDFG +): void { + const symbolsTableBaseContainer = $('
', { + 'class': 'container-fluid attr-table-base-container', + }).appendTo(root); + + const catRow = $('
', { + 'class': 'row attr-table-cat-row', + }).appendTo(symbolsTableBaseContainer); + const catContainer = $('
', { + 'class': 'col-12 attr-table-cat-container', + }).appendTo(catRow); + const catToggleBtn = $('