8000 Feature Request: Add Fullscreen Mode Button for the Editor · Issue #116 · kaliacad/wqsai · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Feature Request: Add Fullscreen Mode Button for the Editor #116
Open
@BirushaNdegeya

Description

@BirushaNdegeya

Feature Request: Add Fullscreen Mode Button for the Editor

Description:
To improve the usability and focus of the editor, we propose adding a fullscreen mode button. This will allow users to expand the editor to fullscreen, providing more space for writing and editing queries without distractions.

Proposed Solution:

  1. Add a fullscreen button (e.g., an icon or toggle) to the editor toolbar.
  2. Use the Fullscreen API (document.fullscreenElement) to toggle fullscreen mode for the editor.
  3. Ensure the fullscreen mode works across different browsers and devices.
  4. Style the button to match the application's design and provide visual feedback when fullscreen mode is active.

Example Implementation:

import { useState } from 'react';
import { FaExpand, FaCompress } from 'react-icons/fa'; // Icons for fullscreen and exit

function Editor() {
  const [isFullscreen, setIsFullscreen] = useState(false);

  const toggleFullscreen = () => {
    const editorElement = document.getElementById('editor');

    if (!isFullscreen) {
      if (editorElement.requestFullscreen) {
        editorElement.requestFullscreen();
      }
    } else {
      if (document.exitFullscreen) {
        document.exitFullscreen();
      }
    }
    setIsFullscreen(!isFullscreen);
  };

  return (
    <div id="editor" className="editor-container">
      <div className="editor-toolbar">
        <button onClick={toggleFullscreen}>
          {isFullscreen ? <FaCompress /> : <FaExpand />}
        </button>
      </div>
      <textarea className="editor-input" />
    </div>
  );
}


# Current State

![Image](https://github.com/user-attachments/assets/fc24225a-54f5-45e5-b8f7-c4cd7391ab80)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0