Skip to content

Conversation

@Shekhar0109
Copy link

Add Adjustable Sidebar Width Feature (Issue #63)

This Pull Request introduces an adjustable sidebar width for the Wiki interface,
adding a more modern, flexible, and user-friendly layout.

🔧 Features Added

  • Sidebar can switch between:
    • Narrow Mode (240px)
    • Wide Mode (360px)
    • Collapsed Mode (0px)
  • Toggle button added to show/hide the sidebar.
  • Search focus auto-expands the sidebar for better usability.
  • Persistent state using localStorage.
  • Smooth transitions using CSS variables.

🧩 Technical Changes

1. JavaScript (wiki/public/js/wiki.js)

  • Added init_adjustable_sidebar() function.
  • Handles:
    • Mode switching
    • Reading/writing preferences to localStorage
    • Event listeners for toggle button and search input

2. SCSS (wiki/public/scss/sidebar.scss)

  • Added new layout system using:
    • CSS grid
    • CSS variable: --sidebar-width
  • Added classes:
    • .sidebar-width-narrow
    • .sidebar-width-wide
    • .sidebar-width-collapsed

3. Wiki Template (wiki/wiki/doctype/wiki_page/templates/wiki_doc.html)

  • Wrapped layout inside:
    • <div id="wiki-layout" class="wiki-layout sidebar-width-narrow">
  • Inserted toggle button inside sidebar
  • Updated structure to support grid layout
  • Moved contributions block safely

🖼️ Result

  • Sidebar now works like modern documentation sites (GitBook, Notion, etc.)
  • Fully responsive
  • Collapsible on demand
  • Smooth UX

🔗 Closes

Closes #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adjustable sidebar width

1 participant