Git Product home page Git Product logo

Comments (5)

dabbott avatar dabbott commented on June 2, 2024

Definitely going to do this in the future, but probably not short-term. If you're interested in figuring out how to add this now, I can point you in the right direction. It'd be a medium-sized amount of work.

Some things are a little bit resizable - e.g. you can shrink the components section to 100px. Just adding a little more customizability, like hide/show for components section would be simple.

from deco-ide.

0xAsimetriq avatar 0xAsimetriq commented on June 2, 2024

@dabbott Definitely! If you could kickstart me in the right direction, I can give this a shot over the weekend :)

from deco-ide.

dabbott avatar dabbott commented on June 2, 2024

@IljaDaderko sweet! Ok, here's how it works currently:

The entire layout is defined here in Workspace: https://github.com/decosoftware/deco-ide/blob/master/web/src/scripts/containers/Workspace.jsx

Currently the different regions are hardcoded. Each region is wrapped in a <Pane />, which can resize either horizontally or vertically. Resizing dispatches actions, e.g. setLeftSidebarWidth, setLeftSidebarBottomSectionHeight, which are in turn saved (confusingly) into both our redux store and localstorage (since your layout should persist across app launches). The styles are returned from the method getStyles.

Separate from sizes, there are actions for hiding/showing the left and right sidebar, setLeftSidebarVisibility, setRightSidebarContent. This happens in WorkspaceToolbar: https://github.com/decosoftware/deco-ide/blob/master/web/src/scripts/containers/WorkspaceToolbar.jsx


Probably the right answer looks more like this:

We have a simple format for the window layout which just specifies positions of boxes using flexbox. Each box has an id which specifies what kind of content to show via a hardcoded map { id => <Component /> }. It's stored into localstorage only, and read out upon usage. This can happen from a utils class, e.g. https://github.com/decosoftware/deco-ide/blob/master/web/src/scripts/utils/RecentProjectUtils.js

I made a little pen of what I have in mind: http://codepen.io/dabbott/pen/GqRpxQ?editors=0010

For inspiration, this project does the whole layout thing pretty well: https://github.com/STRML/react-grid-layout. One option would be to just wrap their <ReactGridLayout /> in a simplified <WorkspaceLayout /> abstraction layer. My guess is it wouldn't work that well though. Their system is grid based, so it might not be flexible enough (I like being able to resize 1px at a time, instead of thinking about rows and columns.

Other approaches are welcome too. I haven't thought too thoroughly about this.

from deco-ide.

0xAsimetriq avatar 0xAsimetriq commented on June 2, 2024

@dabbott Alright, sounds doable! Will probably need to stretch this over a couple of weekends, but will give it a shot!

from deco-ide.

dabbott avatar dabbott commented on June 2, 2024

@IljaDaderko were you ever able to give this a shot?

from deco-ide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.