Commit log

660c337 Refresh all possibly stale diagnostics pat

Kirill Bulatov created

1bce5dc Add checkboxes and their stories

Nate Butler created

b243de4 Simplify toggle, some `ui2` reorganization (#3234)

Click to expand commit body
[[PR Description]]

A few mix organizational things in UI, as well as some toggle changes.

Simplify toggle:

```rust
/// Whether the entry is toggleable, and if so, whether it is currently toggled.
///
/// To make an element toggleable, simply add a `Toggle::Toggled(_)` and handle it's cases.
///
/// You can check if an element is toggleable with `.is_toggleable()`
///
/// Possible values:
/// - `Toggle::NotToggleable` - The entry is not toggleable
/// - `Toggle::Toggled(true)` - The entry is toggleable and toggled
/// - `Toggle::Toggled(false)` - The entry is toggleable and not toggled
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum Toggle {
    NotToggleable,
    Toggled(bool),
}
```

Adds helper functions to easily get the toggle and toggleable states:

```rust
impl Toggle {
    /// Returns true if the entry is toggled (or is not toggleable.)
    ///
    /// As element that isn't toggleable is always "expanded" or "enabled"
    /// returning true in that case makes sense.
    pub fn is_toggled(&self) -> bool {
        match self {
            Self::Toggled(false) => false,
            _ => true,
        }
    }

    pub fn is_toggleable(&self) -> bool {
        match self {
            Self::Toggled(_) => true,
            _ => false,
        }
    }
}
```

Pulls `disclosure_control` out of components and creates a common def:

```rust
pub fn disclosure_control<V: 'static>(toggle: Toggle) -> impl Component<V> {
    match (toggle.is_toggleable(), toggle.is_toggled()) {
        (false, _) => div(),
        (_, true) => div().child(
            IconElement::new(Icon::ChevronDown)
                .color(IconColor::Muted)
                .size(IconSize::Small),
        ),
        (_, false) => div().child(
            IconElement::new(Icon::ChevronRight)
                .color(IconColor::Muted)
                .size(IconSize::Small),
        ),
    }
}
```

disclosure_control will likely get pulled into it's own component in the
future instead of being in toggle.

Release Notes:

- N/A

Nate Butler created

b125cc2 Simplify toggle, do some reorganization

Nate Butler created

86d1def Fix compile errors, now lines are being laid out

Antonio Scandurra created

ac9efae Suppress unused vars warning generated by gpui macro (#3233)

Kirill Bulatov created

9f40a5c Suppress unused vars warning generated by gpui macro

Kirill Bulatov created

de5458c Update tooltip code a bit

Click to expand commit body
This fixes a tiny UX bug where the tooltip would appear to move if you
hovered over an element, then moved your mouse out and back within
500ms.

The fix is to retain the task, so we can drop it to cancel it when the
mouse leaves.

Also changes the time we construct the tooltip to the time it first
shows.

Conrad Irwin created

123439a Merge branch 'main' into add-collab-tests

Mikayla Maki created

e1525e2 Get collab2 green

Mikayla created

436dc93 WIP2000

Max Brunsfeld created

4240952 Allow language injection in markdown code blocks in channel notes (#3231)

Click to expand commit body
Release Notes:

- Fixed an issue where markdown code blocks were not syntax-highlighted
in channel notes editors.

Max Brunsfeld created

2dd32db Allow language injection in markdown code blocks in channel notes

Max Brunsfeld created

4725cd2 Move more tooltip logic into gpui2 & fix tooltip moving on paint

Click to expand commit body
Co-Authored-By: Conrad Irwin <conrad@zed.dev>

Julia and Conrad Irwin created

4cce6ae Add UI docs (#3230)

Click to expand commit body
Not as exciting as it sounds - Just starting to scaffold out some UI
docs and want to get feedback.

Release Notes:

- N/A

Nate Butler created

b0d202b Merge branch 'main' into add-ui-docs

Nate Butler created

9ce7199 Add some initial docs

Nate Butler created

5d36331 storybook2: Remove unreferenced `components` module (#3229)

Click to expand commit body
This PR removes the `components` module from `storybook2` as it was
dead, unreferenced code.

Release Notes:

- N/A

Marshall Bowers created

3834e26 Tooltips in mouse event handler & fix executor timer

Click to expand commit body
Co-Authored-By: Conrad Irwin <conrad@zed.dev>

Julia and Conrad Irwin created

6abdab7 Remove `theme.txt`

Marshall Bowers created

76db100 ui2: Reorganize components (#3228)

Click to expand commit body
This PR reorganizes the components in the `ui2` crate.

The distinction between "elements" and "components" is now gone, with
all of the reusable components living under `components/`.

The components that we built while prototyping but will eventually live
in other crates currently reside in the `to_extract/` module.

Release Notes:

- N/A

Marshall Bowers created

287ea0a Allow deriving `Serialize` and `Deserialize` on generated refinement (#3227)

Click to expand commit body
This PR adds support for deriving `Serialize` and `Deserialize` on the
refinement type generated by `#[derive(Refineable)]`.

Release Notes:

- N/A

Marshall Bowers created

b5224bd Remove unneeded type qualification

Marshall Bowers created

d500b01 Add docs burndown list

Click to expand commit body
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>

Nate Butler and Marshall Bowers created

1361b61 Use an `IconButton` for the tab close button

Marshall Bowers created

740e2cc Start on ui root doc

Click to expand commit body
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>

Nate Butler and Marshall Bowers created

f97046b MOAR TOOLTIPS

Conrad Irwin created

edacffa Refresh diagnostics inside the tab (#3225)

Click to expand commit body
r-a now has 2 different types of diagnostics: 
* "disk-based" ones that come from `cargo check` and related, that emit
`project::Event::DiskBasedDiagnosticsStarted` and
`DiskBasedDiagnosticsFinished`
* "flycheck" diagnostics from r-a itself, that it tries to dynamically
apply to every buffer open, that come with `DiagnosticsUpdated` event.

Latter diagnostics update frequently, on every file close and open, but
`diagnostics.rs` logic had never polled for new diagnostics after
registering the `DiagnosticsUpdated` event, so the only way we could
have newer diagnostics was to re-open the whole panel.
The PR fixes that, and also adds more debug logging to the module.
The logic of the fix looks very familiar to previous related fix:
https://github.com/zed-industries/zed/pull/3128

One notable thing after the fix: "flycheck" diagnostics stay forever if
the diagnostics panel is opened: excerpts in that panel do not allow the
buffer to get dropped (hence, closed in terms of r-a) and get the
updated, zero diagnostics.
If the diagnostics panel is opened and closed multiple times, those
errors gradually disappear.

Release Notes:

- Fixed diagnostics panel not refreshing its contents properly

Kirill Bulatov created

33245d1 Tooltip on tabs

Click to expand commit body
Co-Authored-By: Julia <julia@zed.dev>

Conrad Irwin and Julia created

918d123 Fix the test

Kirill Bulatov created

6f8947a Fix a compilation error

Kirill Bulatov created

9cb8ce1 Refresh diagnostics inside the tab

Kirill Bulatov created

1250036 Merge branch 'main' into import-theme

Marshall Bowers created

fa7d6c0 Remove `Default` impl` for `ThemeColors` (#3226)

Click to expand commit body
This PR removes the `Default` impl for `ThemeColors`.

Since we need default light and dark variants for `ThemeColors`, we
can't use a single `Default` impl.

Release Notes:

- N/A

Marshall Bowers created

c529343 WIP: Port `channel` crate to gpui2 (#3192)

Mikayla Maki created

66499f6 Fix double borrow in synchronous tests that take AppContext

Click to expand commit body
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>

Max Brunsfeld , Mikayla , and Antonio created

2b883bf WIP

Mikayla created

26e64fb gpui2: Add on_hover events

Conrad Irwin created

2a672e2 WIP

Antonio Scandurra created

6a1fb18 Update to latest patterns for porting work

Mikayla created

b085569 Add channel2 crate

Click to expand commit body
Co-authored-by: Marshall <marshall@zed.dev>

Max Brunsfeld and Marshall created

d73c54f Add PointingHand on tabs

Conrad Irwin created

c604a2e Add hover behaviour to tabs

Click to expand commit body
Co-Authored-By: Marshall <marshall@zed.dev>
Co-Authored-By: Nathan <nathan@zed.dev>

Conrad Irwin , Marshall , and Nathan created

a65c177 port rope2 to zed2

KCaverly created

d3b02c4 WIP: start on editor element

Antonio Scandurra created

580694d Fix bug when unsubscribe called after remove

Click to expand commit body
Co-Authored-By: Julia <julia@zed.dev>

Conrad Irwin and Julia created

920ea1b Make the close button close

Conrad Irwin created

b5c2cf3 Ensure panes cover the available space

Antonio Scandurra created

0edcec7 Fix tab text colors

Conrad Irwin created

363d7c6 Exclude source themes from Zed2 binary

Marshall Bowers created