Skip to content

Improve dialog interface #350

@mkoskim

Description

@mkoskim

Situation

This system was quickly created to implement import dialog, and it needs improvements to support different kinds of dialogs.

Currently, the (top-level) dialogs are rendered in the View component, which has the toplevel viewport div:

function View({ doc, updateDoc, buffer, setBuffer }) {

It is called by App component with import dialog related props:

<View key={doc?.key} doc={doc} updateDoc={updateDoc} buffer={importing} setBuffer={setImporting} />

Command interface

Command interface was implemented to remove need to pass doc to file menu, instead we set up a command that is performed at the top level.

Command "switch":

switch (action) {

Functions to create commands:

//-----------------------------------------------------------------------------

Calling functions to create commands:

onClick={e => { cmdNewFile({ setCommand }); popupState.close(e); }}

Dialog improvement

We could follow bit the same interface with dialogs. We would have a command structure to pass arguments to dialogs from deeper components. The we would have a switch or similar to render the dialogs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions