Commit Graph

20 Commits

Author SHA1 Message Date
Benoit Marty
17616d6fc3 Organization renaming: replace all https://github.com/vector-im by https://github.com/element-hq 2023-12-13 09:40:07 +01:00
Benoit Marty
d2ca528679 Detekt: Rename DayNightPreviews to PreviewsDayNight to follow naming convention.
MultiPreview annotations should start with `Previews` as prefix
2023-09-21 08:30:36 +02:00
Benoit Marty
76d448e34b Detekt: Rename LargeHeightPreview to PreviewWithLargeHeight to follow naming convention.
MultiPreview annotations should start with `Preview` as prefix

Detekt: Rename `LargeHeightPreview` to `PreviewWithLargeHeight` to follow naming convention.
Custom Preview annotations should start with `Preview` as prefix
2023-09-21 08:30:15 +02:00
Marco Romano
aed4b92761 Optional day night preview annotation (#793)
Adds the `@DayNightPreviews` annotation that when used on a composable will:
- Display both a day mode and night mode preview in Android Studio.
- Produce both a day and night screenshot during screenshot testing.

The usage of this new annotation is optional, all the current previews continue to work without breakages.
New code can use, when appropriate, the new `@DayNightPreviews` annotation and replace the pattern using three `LightPreview/DarkPreview/ContentToPreview` functions with:

```
@DayNightPreviews
@Composable
fun MyScreenPreview(@PreviewParameter(MyStateProvider::class) state: MyState) {
    ElementPreview {
        MyScreen(
            state = state,
        )
    }
}
```
2023-07-06 12:35:54 +02:00
Marco Romano
f33561c25d Revert "Auto generate dark mode previews and screenshots (#776)" (#784)
This reverts commit 79b529193c.
2023-07-05 15:47:53 +02:00
Marco Romano
79b529193c Auto generate dark mode previews and screenshots (#776)
With this change, composable previews and screenshots should be created with just:
```
@ElementPreviews
@Composable
fun MyViewPreview() {
    ElementPreview { 
        MyView()
    }
}
```

- Adds `@ElementPreviews` which is a shorthand for:
```
@Preview(name = "D")
@Preview(name = "N", uiMode = Configuration.UI_MODE_NIGHT_YES)
```
Should be used in connection with the now public `fun ElementPreview()` composable.

- Adds ElementPreviews to previewAnnotations in dangerfile
- Screenshots of night mode previews are now rendered with night mode
- Replaces `ElementPreviewLight` and `ElementThemedPreview` with `ElementPreview`
- Deprecates `ElementPreviewDark` which should be removed.
- Remaining usages of `ElementPreviewDark` are now ignored during screenshot tests
2023-07-05 13:58:24 +02:00
Chris Smith
0eb195560b Danger: remove "add screenshots" warning (#691)
We have screenshot tests that basically negate the need for this,
and when we're doing more complicated things we tend to use
videos anyway which aren't caught by this check.
2023-06-27 15:37:44 +02:00
Chris Smith
09411f8993 Danger: don't complain about reviewers (#509)
Now we have a CODEOWNERS file a reviewer is assigned automatically,
so there's no need for this.

It also misfires a bunch (maybe if there are no _pending_ reviewers
because they've already reviewed?), so removing it fixes that noise.
2023-06-01 14:02:28 +00:00
Chris Smith
1d041578f7 Make danger check view changes (#391)
Make danger check view changes

Add a check that if a file with @Preview or @LargeHeightPreview
in it is changed, then the corresponding build file includes
the showkase processor.

Also change the check that prompts about screenshots to use
the same @Preview logic instead of checking for "/layout" in
the path which doesn't work with compose.

Also add missing showkase processors
2023-05-05 08:24:12 +00:00
Chris Smith
7e6341c4f3 Add Marco to dangerfile (#388) 2023-05-04 12:39:40 +00:00
Benoit Marty
c38020be34 Merge pull request #179 from vector-im/michaelk/danger_check_github_org
Attempt to check org/group membership before danger complains about signoff.
2023-04-18 10:49:46 +02:00
Michael Kaye
88c0306d7d Check for team membership, not org membership 2023-04-04 12:57:43 +01:00
Michael Kaye
893c95fd77 Fix 2023-04-04 12:48:54 +01:00
Jorge Martín
a80fd11069 Add Chris to the team in the Dangerfile, remove some former colleagues 😢 2023-04-03 16:15:13 +02:00
Jorge Martin Espinosa
9b537bcc01 Try to improve Danger rule for PNGs to ignore screenshots (#234) 2023-03-20 15:09:50 +01:00
Michael Kaye
60de93354b Attempt to check public org membership before complaining about signoff. 2023-03-13 14:30:41 +00:00
Benoit Marty
24e46d2ebe white list renovate, so that the tool does not need to sign-off. 2023-03-07 11:28:52 +01:00
Benoit Marty
19f2310191 Allow user github-actions[bot] to update translations.
Check that new strings are not added to `values/strings.xml`
Signoff not required for "github-actions[bot]" user.
2023-01-19 11:13:48 +01:00
Benoit Marty
45a455f8af Setup towncrier 2023-01-11 14:57:14 +01:00
Benoit Marty
92b06ced6b Add quality workflow and Danger files. 2022-12-09 12:06:37 +01:00