Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiP: Dialog widget #4044

Draft
wants to merge 44 commits into
base: main
Choose a base branch
from
Draft

WiP: Dialog widget #4044

wants to merge 44 commits into from

Commits on Jan 9, 2024

  1. Configuration menu
    Copy the full SHA
    1b82fc9 View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2024

  1. Don't name the body widget like its an internal

    While the intention is that it won't be exported, I think it's sensible to
    give it a "public" name so we can refer to it in styling guides, so
    something can then style:
    
      Dialog > Body { ... }
    
    and so on, without needing to use leading underscores, making it look like
    they shouldn't do that.
    davep committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    492e262 View commit details
    Browse the repository at this point in the history
  2. Flesh out a docstring

    Some of this text is just reminders for the moment, and proper linking will
    need to be done too; but that can come once everything has settled down.
    davep committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    eb23537 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d6d6580 View commit details
    Browse the repository at this point in the history
  4. Add a little more styling

    Far from having the final styles yet; but this gets me started.
    davep committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    f8354d2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9c9d538 View commit details
    Browse the repository at this point in the history
  6. Import tidy

    davep committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    7a54458 View commit details
    Browse the repository at this point in the history
  7. Isolate the dialog parts from the usual containers

    I was inheriting from various containers to build up the key parts of the
    dialog; the problem with that is that it's pretty easy for a developer using
    this dialog to also have done some pretty simple app-level styling of a
    Vertical or a Horizontal, and then things would start to fall apart in ways
    they might not expect.
    
    So here I just inherit from Widget and style the width/height/layout as
    needed. It's not much extra work and it helps keep some isolation.
    davep committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    65ffbdf View commit details
    Browse the repository at this point in the history
  8. Add a bit of debug code

    While I'm trying to get to the bottom of how best to size all the various
    parts of the dialog, let's make it easier to see what part of the display is
    responsible for what space.
    davep committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    0078d0d View commit details
    Browse the repository at this point in the history
  9. Remove the width for the Body

    I want this, but this managed to sneak in too early; so reverting.
    
    There's currently a problem of wanting to width/height: auto this, but cap
    it at 1fr within the max-width/height of its container. Textual can't handle
    that right now; so we either need to find a better way of pulling this off,
    or CSS might need a bit of a tweak to support this.
    davep committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    91a6207 View commit details
    Browse the repository at this point in the history
  10. Experiment with a get_content_height hack

    The plan isn't go actually go with this; but this sort of implements what
    I'm aiming for; so we'll riff on this for the moment.
    davep committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    99157f3 View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2024

  1. Experiment some more with controlling the height of the body

    Tidying up the way I calculate the ideal height for the body. As mentioned
    before, this isn't the ideal way to do things; it can give a flicker as the
    dialog is first shown; but it's an approximation of what I want at least.
    davep committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    a8e4157 View commit details
    Browse the repository at this point in the history
  2. Remove debug styling

    davep committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    8f58de3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0f0010e View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2024

  1. Fix a typo

    davep committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    fd84c04 View commit details
    Browse the repository at this point in the history
  2. Fix a typo

    davep committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    4b5560d View commit details
    Browse the repository at this point in the history
  3. Add initial support for variants

    I think I'll want to dial in the styling some more; but this is the core
    framework for this.
    davep committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    8788aa6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    69ffc18 View commit details
    Browse the repository at this point in the history
  5. Tidy up the DOM info debug code

    davep committed Jan 15, 2024
    Configuration menu
    Copy the full SHA
    0674684 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c24c989 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c4fdbfb View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2024

  1. Configuration menu
    Copy the full SHA
    da312bc View commit details
    Browse the repository at this point in the history
  2. Add the scaffolding for Dialog documentation

    More to add to this, more to write, but this kicks off the basics for
    documenting the Dialog.
    davep committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    2308463 View commit details
    Browse the repository at this point in the history
  3. Remove some debug code

    davep committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    871104a View commit details
    Browse the repository at this point in the history
  4. Fix a copy/paste-o

    davep committed Jan 16, 2024
    Configuration menu
    Copy the full SHA
    5011b9e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cee3962 View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2024

  1. Configuration menu
    Copy the full SHA
    038e385 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    573225f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    031dbf3 View commit details
    Browse the repository at this point in the history
  4. Remove the additional notes

    I think there might be some to add, still to be decided, but now's a good
    time to remove the placeholder in case that doesn't happen.
    davep committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    989bfaf View commit details
    Browse the repository at this point in the history
  5. Add an exception for a misplaced ActionArea widget

    There's little point in someone putting one of these anywhere other than
    inside a Dialog; so blow up if they do.
    davep committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    085f68f View commit details
    Browse the repository at this point in the history
  6. Move the checking for multiple ActionArea into on_mount

    This helps make testing for this easier; for one thing.
    davep committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    0faf005 View commit details
    Browse the repository at this point in the history
  7. Add initial testing for Dialog

    Just some of the exception testing for now.
    davep committed Jan 17, 2024
    Configuration menu
    Copy the full SHA
    c4d0161 View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2024

  1. Use get_child_by_type rather than query_one

    While I would never encourage it, ever, this does allow for a dialog within
    a dialog (and, really, just don't!).
    davep committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    1282003 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    15af7d1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b40d3f9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b5303a6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4f1f3e6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    feebb98 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e8e4edb View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    251d536 View commit details
    Browse the repository at this point in the history
  9. Remove example code from the docstring for Dialog

    There are more comprehensive examples in the main documentation; there's
    little point in having a cut-down version in the code too.
    davep committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    0927938 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    41e2dc7 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    89de939 View commit details
    Browse the repository at this point in the history