diff --git a/assets/css/js_interop.css b/assets/css/js_interop.css index 0138879fb..bac2d88eb 100644 --- a/assets/css/js_interop.css +++ b/assets/css/js_interop.css @@ -115,7 +115,7 @@ solely client-side operations. @apply invisible; } -[data-el-sections-list-item][data-js-is-viewed] { +[data-el-outline-item][data-js-is-viewed] { @apply text-gray-900; } @@ -219,8 +219,8 @@ solely client-side operations. @apply hidden; } -[data-el-session]:not([data-js-side-panel-content="sections-list"]) - [data-el-sections-list] { +[data-el-session]:not([data-js-side-panel-content="outline"]) + [data-el-outline] { @apply hidden; } @@ -254,8 +254,8 @@ solely client-side operations. @apply hidden; } -[data-el-session][data-js-side-panel-content="sections-list"] - [data-el-sections-list-toggle] { +[data-el-session][data-js-side-panel-content="outline"] + [data-el-outline-toggle] { @apply text-gray-50 bg-gray-700; } diff --git a/assets/js/hooks/session.js b/assets/js/hooks/session.js index 072ec41b8..31a0c3c87 100644 --- a/assets/js/hooks/session.js +++ b/assets/js/hooks/session.js @@ -107,8 +107,8 @@ const Session = { document.addEventListener("focus", this._handleDocumentFocus, true); document.addEventListener("click", this._handleDocumentClick); - this.getElement("sections-list").addEventListener("click", (event) => { - this.handleSectionsListClick(event); + this.getElement("outline").addEventListener("click", (event) => { + this.handleOutlineClick(event); this.handleCellIndicatorsClick(event); }); @@ -116,8 +116,8 @@ const Session = { this.handleClientsListClick(event), ); - this.getElement("sections-list-toggle").addEventListener("click", (event) => - this.toggleSectionsList(), + this.getElement("outline-toggle").addEventListener("click", (event) => + this.toggleOutline(), ); this.getElement("clients-list-toggle").addEventListener("click", (event) => @@ -374,7 +374,7 @@ const Session = { } else if (keyBuffer.tryMatch(["e", "s"])) { this.queueFocusedSectionEvaluation(); } else if (keyBuffer.tryMatch(["s", "o"])) { - this.toggleSectionsList(); + this.toggleOutline(); } else if (keyBuffer.tryMatch(["s", "e"])) { this.toggleSecretsList(); } else if (keyBuffer.tryMatch(["s", "a"])) { @@ -575,10 +575,10 @@ const Session = { }, /** - * Handles section link clicks in the section list. + * Handles link clicks in the outline panel. */ - handleSectionsListClick(event) { - const sectionButton = event.target.closest(`[data-el-sections-list-item]`); + handleOutlineClick(event) { + const sectionButton = event.target.closest(`[data-el-outline-item]`); if (sectionButton) { const sectionId = sectionButton.getAttribute("data-section-id"); @@ -587,7 +587,7 @@ const Session = { } const sectionDefinitionButton = event.target.closest( - `[data-el-sections-list-definition-item]`, + `[data-el-outline-definition-item]`, ); if (sectionDefinitionButton) { @@ -695,7 +695,7 @@ const Session = { */ updateSectionListHighlight() { const currentListItem = this.el.querySelector( - `[data-el-sections-list-item][data-js-is-viewed]`, + `[data-el-outline-item][data-js-is-viewed]`, ); if (currentListItem) { @@ -714,7 +714,7 @@ const Session = { if (viewedSection) { const sectionId = viewedSection.getAttribute("data-section-id"); const listItem = this.el.querySelector( - `[data-el-sections-list-item][data-section-id="${sectionId}"]`, + `[data-el-outline-item][data-section-id="${sectionId}"]`, ); listItem.setAttribute("data-js-is-viewed", ""); } @@ -830,8 +830,8 @@ const Session = { // User action handlers (mostly keybindings) - toggleSectionsList(force = null) { - this.toggleSidePanelContent("sections-list", force); + toggleOutline(force = null) { + this.toggleSidePanelContent("outline", force); }, toggleClientsList(force = null) { diff --git a/lib/livebook_web/live/session_live/render.ex b/lib/livebook_web/live/session_live/render.ex index 68cecd7bd..c5bbd3ba1 100644 --- a/lib/livebook_web/live/session_live/render.ex +++ b/lib/livebook_web/live/session_live/render.ex @@ -333,7 +333,7 @@ defmodule LivebookWeb.SessionLive.Render do <.button_item icon="node-tree" label="Outline (so)" - button_attrs={["data-el-sections-list-toggle": true]} + button_attrs={["data-el-outline-toggle": true]} /> <.button_item @@ -419,7 +419,7 @@ defmodule LivebookWeb.SessionLive.Render do class="flex flex-col h-full w-full max-w-xs absolute z-30 top-0 left-[64px] overflow-y-auto shadow-xl md:static md:shadow-none bg-gray-50 border-r border-gray-100 px-6 pt-16 md:py-8" data-el-side-panel > -
+
<.outline_list data_view={@data_view} />
@@ -508,7 +508,7 @@ defmodule LivebookWeb.SessionLive.Render do