Merge pull request #3705 from element-hq/feature/bma/sheetContentPreview

Rename some function to avoid name clash
This commit is contained in:
Benoit Marty
2024-10-18 17:53:24 +02:00
committed by GitHub
31 changed files with 39 additions and 8 deletions

View File

@@ -146,7 +146,7 @@ fun ActionListView(
onDismissRequest = ::onDismiss,
modifier = modifier,
) {
SheetContent(
ActionListViewContent(
state = state,
onActionClick = ::onItemActionClick,
onEmojiReactionClick = ::onEmojiReactionClick,
@@ -161,7 +161,7 @@ fun ActionListView(
}
@Composable
private fun SheetContent(
private fun ActionListViewContent(
state: ActionListState,
onActionClick: (TimelineItemAction) -> Unit,
onEmojiReactionClick: (String) -> Unit,
@@ -442,10 +442,10 @@ private fun EmojiButton(
@PreviewsDayNight
@Composable
internal fun SheetContentPreview(
internal fun ActionListViewContentPreview(
@PreviewParameter(ActionListStateProvider::class) state: ActionListState
) = ElementPreview {
SheetContent(
ActionListViewContent(
state = state,
onActionClick = {},
onEmojiReactionClick = {},

View File

@@ -89,14 +89,14 @@ fun ReactionSummaryView(
sheetState = sheetState,
modifier = modifier
) {
SheetContent(summary = state.target)
ReactionSummaryViewContent(summary = state.target)
}
}
}
@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun SheetContent(
private fun ReactionSummaryViewContent(
summary: ReactionSummaryState.Summary,
) {
val animationScope = rememberCoroutineScope()
@@ -274,8 +274,8 @@ private fun SenderRow(
@PreviewsDayNight
@Composable
internal fun SheetContentPreview(
internal fun ReactionSummaryViewContentPreview(
@PreviewParameter(ReactionSummaryStateProvider::class) state: ReactionSummaryState
) = ElementPreview {
SheetContent(summary = state.target as ReactionSummaryState.Summary)
ReactionSummaryViewContent(summary = state.target as ReactionSummaryState.Summary)
}

View File

@@ -10,6 +10,7 @@ import os
import re
import sys
import time
from util import compare
@@ -100,6 +101,34 @@ def computeDarkFileName(lightFileName):
return match.group(1) + "_Night_" + match.group(2) + "_" + match.group(3)
return ""
def checkForScreenshotNameDuplication():
__doc__ = "Check for screenshots name duplication"
print("Check for screenshots name duplication...")
files = os.listdir("tests/uitests/src/test/snapshots/images/")
dict = {}
for file in files:
start = file.find("_") + 1
end = file.find("_", start)
screenshotName = file[start:end]
if screenshotName in dict:
dict[screenshotName].append(file[:end])
else:
dict[screenshotName] = [file[:end]]
error = 0
for key in dict:
if key in ["Icon", "RoundIcon"]:
continue
values = set(dict[key])
if len(values) > 1:
print("Duplicated screenshot name: %s" % key)
for value in values:
print(" - %s" % value)
error += 1
if error:
print("Warning: %d duplicated screenshot name(s) found" % error)
def generateJavascriptFile():
__doc__ = "Generate a javascript file to load the screenshots"
print("Generating javascript file...")
@@ -151,6 +180,7 @@ def generateJavascriptFile():
def main():
checkForScreenshotNameDuplication()
generateAllScreenshots(readArguments())
lang = detectLanguages()
for l in lang:
@@ -158,4 +188,5 @@ def main():
moveScreenshots(l)
generateJavascriptFile()
main()