Skip to content

Commit 63da9cb

Browse files
authored
refactor: move the section order reset into the editor tab (#115)
The undo-reordering button used to sit in the tab bar next to the tab list, visible on every tab even though it only acts on the Editor tab's section list. It now lives inside the Editor tab content, right-aligned above the list, so the control sits in the scope it affects and the tab bar goes back to being pure navigation. This mirrors the Document tab's styling-reset placement, giving both panels the same idiom. The row carries a screen-reader-only "Sections" heading for context, and the button matches the Document tab's reset sizing. New heading strings land in both locales. Testing: on the Editor tab the reset renders above the section list and stays disabled while the order is canonical; on the Layout and Document tabs it does not render at all; the tab bar contains only the three tabs. Signed-off-by: Rizki Citra <rimzzlabs@proton.me>
1 parent 0cebf8f commit 63da9cb

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

messages/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@
564564
"hideSection": "Hide section",
565565
"reorderSection": "Reorder section",
566566
"resetOrder": "Reset section order",
567+
"sectionsHeading": "Sections",
567568
"addSection": "Custom Section",
568569
"tabDocument": "Document"
569570
},

messages/id.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@
564564
"hideSection": "Sembunyikan bagian",
565565
"reorderSection": "Ubah urutan bagian",
566566
"resetOrder": "Setel ulang urutan bagian",
567+
"sectionsHeading": "Bagian",
567568
"addSection": "Bagian Khusus",
568569
"tabDocument": "Dokumen"
569570
},

src/components/editor/editor-sections/ed-section-order-reset.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ export function EditorSectionOrderReset() {
3333
<TooltipTrigger
3434
render={
3535
<Button
36-
size="icon-xs"
36+
size="icon-sm"
3737
variant="ghost"
38-
className="ml-auto"
3938
disabled={disabled}
4039
onClick={() => resetSectionOrder()}
4140
/>

src/components/editor/editor-sidebar-content.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,16 @@ export function EditorSidebarContent() {
4040
</TabsTrigger>
4141
))}
4242
</TabsList>
43-
<EditorSectionOrderReset />
4443
</div>
4544

4645
<TabsContent value="editor">
4746
<ScrollArea id="tour-editor-sections" className={PANEL_HEIGHT}>
47+
<div className="flex items-center justify-end px-4 pt-4">
48+
<h3 className="text-sm font-medium sr-only">
49+
{t("sectionsHeading")}
50+
</h3>
51+
<EditorSectionOrderReset />
52+
</div>
4853
<EditorSectionList />
4954
</ScrollArea>
5055
</TabsContent>

0 commit comments

Comments
 (0)