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

Tweak idea plugin UI #443

Merged
merged 2 commits into from
Jul 27, 2024
Merged

Conversation

takahirom
Copy link
Owner

The Gradle tasks used to shrink like this:
image

We move the status label to the bottom
image

Comment on lines +47 to +54
val actionToolbarConstraints = GridBagConstraints().apply {
insets = JBUI.insets(4)
gridx = 0
gridy = 0
anchor = GridBagConstraints.WEST
}
add(_statusLabel, gbc)
val hRGlueConstraints = gbc.apply {
add(actionToolbar.component, actionToolbarConstraints)
add(JBBox.createHorizontalGlue(), GridBagConstraints().apply {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe now that we have the status label moved to the bottom we could just use a BorderLayout so we don't have to set all these constraints and the horizontal glue.

Minor: Also I foresee the border still showing when the actionToolbar visibility is toggled to false. We could toggle the JBox instead that's if we wrap the actionToolbar into the JBBox's horizontal box. Something along the lines:

...
 private val jbBox = JBBox.createHorizontalBox()

  init {
    actionToolbar.setTargetComponent(this)
    add(jbBox.apply {
      isVisible = false
      setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4))
      add(actionToolbar.component, GridBagConstraints().apply {
        gridx = 0
        gridy = 0
        anchor = GridBagConstraints.WEST
        insets = JBUI.insets(4)
      })
    }, BorderLayout.WEST)
  }

  fun setActions(actions: List<ToolbarAction>) {
    if (actions.isEmpty()) {
      jbBox.isVisible = false
      return
    }
    jbBox.isVisible = true
    val actionList = listOf(*actions.toTypedArray())
    actionToolbar.setActions(actionList)
  }
...  

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your advice. I released it a few days ago. I want to include these changes, but I'm a little busy. I'll do this the next time I modify the plugin, but if you could do it, it would be highly appreciated.

Copy link
Contributor

@eyedol eyedol Jul 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I'll look into it. And no problem

@takahirom takahirom closed this Jul 27, 2024
@takahirom takahirom reopened this Jul 27, 2024
@takahirom takahirom merged commit d71cc54 into main Jul 27, 2024
12 checks passed
@takahirom takahirom deleted the takahirom/tweak-idea-plugin-ui/2024-07-23 branch July 27, 2024 07:13
github-merge-queue bot referenced this pull request in slackhq/circuit Jul 29, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[io.github.takahirom.roborazzi](https://togithub.com/takahirom/roborazzi)
| plugin | minor | `1.23.0` -> `1.24.0` |
|
[io.github.takahirom.roborazzi:roborazzi-junit-rule](https://togithub.com/takahirom/roborazzi)
| dependencies | minor | `1.23.0` -> `1.24.0` |
|
[io.github.takahirom.roborazzi:roborazzi-compose](https://togithub.com/takahirom/roborazzi)
| dependencies | minor | `1.23.0` -> `1.24.0` |
|
[io.github.takahirom.roborazzi:roborazzi](https://togithub.com/takahirom/roborazzi)
| dependencies | minor | `1.23.0` -> `1.24.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>takahirom/roborazzi (io.github.takahirom.roborazzi)</summary>

###
[`v1.24.0`](https://togithub.com/takahirom/roborazzi/releases/tag/1.24.0)

[Compare
Source](https://togithub.com/takahirom/roborazzi/compare/1.23.0...1.24.0)

##### New feature: Support for includePrivatePreviews in Compose Preview
Support

Compose Preview Support, initially released in version 1.22.0, now
includes the `includePrivatePreviews` option. This feature allows you to
include private previews in your Compose Preview Support setup. You can
enable this by setting `includePrivatePreviews` in
`roborazzi.generateComposePreviewRobolectricTests.includePrivatePreviews`.
Thank you for submitting this feature request,
[@&#8203;yuchan2215](https://togithub.com/yuchan2215) !

##### New feature: JUnit rule support in ComposePreviewTester

We've enhanced ComposePreviewTester to support JUnit rules. Previously,
ComposePreviewTester lacked lifecycle hooks, which made certain
scenarios challenging to handle. Now, you can pass your own Test rules,
including your Compose Test Rule, and use them in tests. For a sample
implementation, check out [this integration
test](https://togithub.com/takahirom/roborazzi/blob/2519f46ec0e5a8dadc5139ae833e2925c90c8b21/include-build/roborazzi-gradle-plugin/src/integrationTest/projects/sample-generate-preview-tests/src/test/java/com/github/takahirom/sample/CustomPreviewTester.kt).

##### Breaking changes for users of the `ComposePreviewTester` interface

As we continue to improve Compose Preview Support, we've made some
changes to the `ComposePreviewTester` interface. These changes introduce
a breaking change for current users.

ComposePreviewTester is an interface for modifying the behavior of
Compose Preview Support. Previously, the API was prone to breaking
changes with each new option added. We've addressed this issue by
introducing a new `options()` function. However, this necessitates a
change in how you use the interface.

Old interface:

```kotlin
fun previews(vararg packages: String): List<ComposablePreview<T>>
```

New interface (Packages can now be accessed via
`options().scanOptions.packages`):

```kotlin
fun previews(): List<ComposablePreview<T>>
```

##### Acknowledgments

We'd like to extend our sincere thanks to
[@&#8203;yschimke](https://togithub.com/yschimke) and
[@&#8203;sergio-sastre](https://togithub.com/sergio-sastre) for their
valuable design reviews and insightful feedback, which greatly
contributed to the improvements in this release.

##### What's Changed

- \[Idea Plugin] Improve performance of idea plugin by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/439](https://togithub.com/takahirom/roborazzi/pull/439)
- \[Idea Plugin] Prepare for release of IntelliJ IDEA plugin by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/442](https://togithub.com/takahirom/roborazzi/pull/442)
- \[Idea Plugin] Tweak idea plugin UI by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/443](https://togithub.com/takahirom/roborazzi/pull/443)
- \[Feature, Breaking Changes] Support includePrivatePreviews of
ComposablePreviewScanner by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/445](https://togithub.com/takahirom/roborazzi/pull/445)
- \[Docs] Add mention to the sample in Compose Preview Support document
by [@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/448](https://togithub.com/takahirom/roborazzi/pull/448)
- \[Docs] Fix URL of the README link by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/449](https://togithub.com/takahirom/roborazzi/pull/449)

**Full Changelog**:
takahirom/roborazzi@1.23.0...1.24.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44LjMiLCJ1cGRhdGVkSW5WZXIiOiIzOC44LjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->
chrisbanes referenced this pull request in chrisbanes/haze Aug 1, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[io.github.takahirom.roborazzi](https://togithub.com/takahirom/roborazzi)
| `1.23.0` -> `1.25.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/io.github.takahirom.roborazzi/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.github.takahirom.roborazzi/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.github.takahirom.roborazzi/1.23.0/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.github.takahirom.roborazzi/1.23.0/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[io.github.takahirom.roborazzi:roborazzi-junit-rule](https://togithub.com/takahirom/roborazzi)
| `1.23.0` -> `1.25.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/io.github.takahirom.roborazzi:roborazzi-junit-rule/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.github.takahirom.roborazzi:roborazzi-junit-rule/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.github.takahirom.roborazzi:roborazzi-junit-rule/1.23.0/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.github.takahirom.roborazzi:roborazzi-junit-rule/1.23.0/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[io.github.takahirom.roborazzi:roborazzi-compose-desktop](https://togithub.com/takahirom/roborazzi)
| `1.23.0` -> `1.25.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/io.github.takahirom.roborazzi:roborazzi-compose-desktop/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.github.takahirom.roborazzi:roborazzi-compose-desktop/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.github.takahirom.roborazzi:roborazzi-compose-desktop/1.23.0/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.github.takahirom.roborazzi:roborazzi-compose-desktop/1.23.0/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[io.github.takahirom.roborazzi:roborazzi-compose](https://togithub.com/takahirom/roborazzi)
| `1.23.0` -> `1.25.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/io.github.takahirom.roborazzi:roborazzi-compose/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.github.takahirom.roborazzi:roborazzi-compose/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.github.takahirom.roborazzi:roborazzi-compose/1.23.0/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.github.takahirom.roborazzi:roborazzi-compose/1.23.0/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[io.github.takahirom.roborazzi:roborazzi](https://togithub.com/takahirom/roborazzi)
| `1.23.0` -> `1.25.0` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/io.github.takahirom.roborazzi:roborazzi/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.github.takahirom.roborazzi:roborazzi/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.github.takahirom.roborazzi:roborazzi/1.23.0/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.github.takahirom.roborazzi:roborazzi/1.23.0/1.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>takahirom/roborazzi (io.github.takahirom.roborazzi)</summary>

###
[`v1.25.0`](https://togithub.com/takahirom/roborazzi/releases/tag/1.25.0)

[Compare
Source](https://togithub.com/takahirom/roborazzi/compare/1.24.0...1.25.0)

##### New Experimental Gradle Task: `clear`

The Roborazzi Gradle Plugin saves image caches in
`build/intermediates/roborazzi`. When users remove images in
`build/outputs/roborazzi` and rerun the tests, it doesn't work as
expected. To address this, we've added a Gradle task
`clearRoborazziDebug` to remove all images.

I'm gathering feedback about this task in
[#&#8203;452](https://togithub.com/takahirom/roborazzi/issues/452).
Please let me know if this causes any issues in your workflow. I'm aware
that there are many different ways to use Roborazzi, and I'd like to
improve your project workflow.

##### What's Changed

- \[IDE Plugin] Hide dropdown border if no gradle tasks exists by
[@&#8203;eyedol](https://togithub.com/eyedol) in
[https://github.com/takahirom/roborazzi/pull/451](https://togithub.com/takahirom/roborazzi/pull/451)
Thank you for your contribution!
- \[Feature] Add clear roborazzi task by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/453](https://togithub.com/takahirom/roborazzi/pull/453)

**Full Changelog**:
takahirom/roborazzi@1.24.0...1.25.0

###
[`v1.24.0`](https://togithub.com/takahirom/roborazzi/releases/tag/1.24.0)

[Compare
Source](https://togithub.com/takahirom/roborazzi/compare/1.23.0...1.24.0)

##### New feature: Support for includePrivatePreviews in Compose Preview
Support

Compose Preview Support, initially released in version 1.22.0, now
includes the `includePrivatePreviews` option. This feature allows you to
include private previews in your Compose Preview Support setup. You can
enable this by setting `includePrivatePreviews` in
`roborazzi.generateComposePreviewRobolectricTests.includePrivatePreviews`.
Thank you for submitting this feature request,
[@&#8203;yuchan2215](https://togithub.com/yuchan2215) !

##### New feature: JUnit rule support in ComposePreviewTester

We've enhanced ComposePreviewTester to support JUnit rules. Previously,
ComposePreviewTester lacked lifecycle hooks, which made certain
scenarios challenging to handle. Now, you can pass your own Test rules,
including your Compose Test Rule, and use them in tests. For a sample
implementation, check out [this integration
test](https://togithub.com/takahirom/roborazzi/blob/2519f46ec0e5a8dadc5139ae833e2925c90c8b21/include-build/roborazzi-gradle-plugin/src/integrationTest/projects/sample-generate-preview-tests/src/test/java/com/github/takahirom/sample/CustomPreviewTester.kt).

##### Breaking changes for users of the `ComposePreviewTester` interface

As we continue to improve Compose Preview Support, we've made some
changes to the `ComposePreviewTester` interface. These changes introduce
a breaking change for current users.

ComposePreviewTester is an interface for modifying the behavior of
Compose Preview Support. Previously, the API was prone to breaking
changes with each new option added. We've addressed this issue by
introducing a new `options()` function. However, this necessitates a
change in how you use the interface.

Old interface:

```kotlin
fun previews(vararg packages: String): List<ComposablePreview<T>>
```

New interface (Packages can now be accessed via
`options().scanOptions.packages`):

```kotlin
fun previews(): List<ComposablePreview<T>>
```

##### Acknowledgments

We'd like to extend our sincere thanks to
[@&#8203;yschimke](https://togithub.com/yschimke) and
[@&#8203;sergio-sastre](https://togithub.com/sergio-sastre) for their
valuable design reviews and insightful feedback, which greatly
contributed to the improvements in this release.

##### What's Changed

- \[Idea Plugin] Improve performance of idea plugin by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/439](https://togithub.com/takahirom/roborazzi/pull/439)
- \[Idea Plugin] Prepare for release of IntelliJ IDEA plugin by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/442](https://togithub.com/takahirom/roborazzi/pull/442)
- \[Idea Plugin] Tweak idea plugin UI by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/443](https://togithub.com/takahirom/roborazzi/pull/443)
- \[Feature, Breaking Changes] Support includePrivatePreviews of
ComposablePreviewScanner by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/445](https://togithub.com/takahirom/roborazzi/pull/445)
- \[Docs] Add mention to the sample in Compose Preview Support document
by [@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/448](https://togithub.com/takahirom/roborazzi/pull/448)
- \[Docs] Fix URL of the README link by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/449](https://togithub.com/takahirom/roborazzi/pull/449)

**Full Changelog**:
takahirom/roborazzi@1.23.0...1.24.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/chrisbanes/haze).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants