Git Product home page Git Product logo

player's People

Contributors

aarianasingh avatar adierkens avatar brocollie08 avatar hborawski avatar intuit-svc avatar ketanreddy avatar kurultai avatar kvsroyal avatar manansharma18 avatar mercillo avatar nancywu1 avatar skodamarthi avatar sugarmanz avatar tieukhang avatar yian17 avatar zwu011 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

player's Issues

Fix flaky iOS tests

The iOS ManagedPlayerViewModel tests cause random failures in CircleCI but not locally.

Explore different methods for asserting on published values to avoid tests failing in CI

Document release cadence + process

Determine working model for releases

  • Cadence
  • Process
    • How to trigger a release
  • Migration Guides
  • Versioned documentation
  • Prerelease testing plan

Make release script idempotent in case of failure

The release script should handle being called multiple times in case of failure for one of the steps.

  • If a published version of a package already exists -- skip publishing and do nothing
  • If a published version does not exist, attempt to publish and fail the script on failure

Open questions:

  • If a package publishing fails, should we continue to try and publish others? or bail the whole script early? In either scenario, the overall script should fail.

Android contribution/readme guide

I would like to expand our documentation for getting started with Android.

Right now we have a read me that is as bare as it gets.
Including steps on how to run and test a local build of player on android would be great for anyone who wants to start and is new with android/kotlin.

Can add in any troubleshooting that you encountered during your setup.

iOS: Enhance Demo App

To better showcase various plugins and functionality, the iOS demo app needs to be enhanced to load more than flows for the reference assets.

The web storybook has some additional, non reference asset examples as well.

Update the iOS Demo app to give working examples of additional features:

  • ManagedPlayer
  • PubSubPlugin
  • BeaconPlugin
  • ExternalActionPlugin/ExternalActionViewModifierPlugin

These new examples should also include XCUI tests

Android: Enhance Demo App

To better showcase various plugins and functionality, the Android demo app needs to be enhanced to load more than flows for the reference assets.

The web storybook has some additional, non reference asset examples as well.

Update the Android Demo app to give working examples of additional features:

  • ManagedPlayer
  • PubSubPlugin
  • BeaconPlugin
  • ExternalActionPlugin

These new examples should also include Espresso tests

Core: New Reference Asset - Choice

To reduce the time it takes for new users to evaluate Player, we need to expand the reference asset set to incoporate more common user interaction patterns.

A choice asset represents a single selection choice, often displayed as radio buttons in a web context. This will allow users to test out more complex flows than just inputs + buttons.

Requirements

choice

  • A choice asset must have a title to give the user context on what choice they are making
    • The title should be an asset
  • A choice asset can have an optional note to provide more detailed information about the selection
    • The note should be an asset
  • A choice asset should update the value of a binding property supplied to it
  • A choice asset should retrieve validation information for its binding, and expose that for all rendering platforms to display
  • A choice asset will have an array of choices
    • Each entry in choices will not be an asset, as the choice assets per platform will need direct control over the layout
    • Each entry must have a value that is set to the binding when the option is selected
      • The value should be a primitive
    • Each entry must have a label that describes what value is being selected
      • The label should be an asset

Execution

  1. Create a new choice asset in the core reference assets and add types for the authored content, and the transformed content.
  2. Create a transform for this choice asset
    1. The transform should use the binding and provide functions on the transformed type to make it simple for the rendering platform to select an option, similar to run in the action asset
    2. The transform should populate a property on each choice to indicate its selection status
    3. validation to be populated from the binding/schema information
      1. validation is not a content authored field
  3. Add mocks to the mocks package to exercise required and optional fields, to ease unit testing, and implementations for rendering
  4. Add the DSL Component for choice to allow programmatic content authoring
    1. DSL Docs
    2. Add unit test to verify JSON conversion of the DSL component
  5. Add unit tests for the transform
    1. Verify selecting options
    2. Verify validation information being populated

Simplify package layout for JS libraries

In large projects, managing the transitive Player libraries (binding, expression, etc) can be frustrating when yarn or npm chooses to pull in a different version.

Moving to just exposing @player-ui/player and @player-ui/react as the public facing packages (and bundling the rest of core) should help reduce that churn.

iOS: Migrate to build with SPM + Bazel

Migrate away from CocoaPods as a package manager, and build through SPM

We will still publish to CocoaPods but we do not need to build and resolve our dependencies through it, as it complicates usage of Bazel

Performance Testing Suite

In order to benchmark each platform as well as core, we will need to add a performance test suite.

Specific cases for the following should be included at a minimum, with varying complexity:

  • Templates
  • Switches
  • Applicability
  • DataChangeListener

Provide the bridge to Android Player for Jetpack Compose users

Give the consumers a way to render Android Player rendered UI as a @Composable so they are able to choose between rendering Composable Player assets and traditional Android view Player assets

We currently have working code for a composable Android ManagedPlayer (multi-flow experiences) as follows

@Composable
fun ManagedPlayer(
    plugins: List<Plugin>,
    flowManager: AsyncFlowIterator,
    onComplete: @Composable (CompletedState?) -> Unit,
    fallback: @Composable (Throwable) -> Unit,
    loading: @Composable () -> Unit = { CircularProgressIndicator() },
    modifier: Modifier = Modifier,
) {
    val viewModel = remember(plugins, flowManager) {
        object : PlayerViewModel(flowManager) {
            override val plugins = plugins
        }
    }
    LaunchedEffect(viewModel) {
        viewModel.start()
    }
    ManagedPlayer(viewModel, onComplete, fallback, loading, modifier)
}


@Composable
fun ManagedPlayer(
    playerViewModel: PlayerViewModel,
    onComplete: @Composable (CompletedState?) -> Unit,
    fallback: @Composable (ManagedPlayerErrorContext) -> Unit,
    loading: @Composable () -> Unit = { CircularProgressIndicator() },
    modifier: Modifier = Modifier,
) {
    Box(
        Modifier
            .fillMaxSize()
            .verticalScroll(rememberScrollState())
            .background(brush = outsideOrbVerticalGradient)
            .then(modifier),
        propagateMinConstraints = true,
    ) {
        val state by playerViewModel.state.collectAsState()
        when (val currentState = state) {
            ManagedPlayerState.NotStarted -> loading()
            ManagedPlayerState.Pending -> loading()
            is ManagedPlayerState.Running -> currentState.asset?.compose()
            is ManagedPlayerState.Error -> fallback(ManagedPlayerErrorContext(currentState.exception, playerViewModel::retry, playerViewModel::start))
            is ManagedPlayerState.Done -> onComplete(currentState.completedState)
        }
    }
}

class ManagedPlayerErrorContext(
    val error: Throwable,
    val retry: () -> Unit,
    val reset: () -> Unit
)

This code has not been moved into this project, we would like to potentially patternize it and move it over, as well as creating a similar composable for a single flow experience by feeding in an AsyncFlowIterator with one flow

iOS: New Reference Asset - Choice

Depends on #181

Consuming the new core choice, provide a rendering implementation in SwiftUI that displays the asset a list of "tiles". While the React implementation will use radio buttons, that UX is not as ideal on mobile devices, and we should opt for slightly larger controls.

A "tile" can be described as follows:

  • A tile is a container with rounded corners, and a slight shadow to lift it off the content behind it
  • A tile that is currently selected has no shadow, and a green stroke around the border of the tile

For this choice asset:

  • Render the label of each choice entry inside each tile

  • Render the title of the choice above the list of tiles

  • Render validation information below the list of tiles

Infographics/visuals for Documentation

Is your feature request related to a problem? Please describe.
Would love to see different ways to enhance our documentation and guides. Player has a lot of moving parts and how things tie in together can be confusing at first glance. Some people may learn better through visuals.

Describe the solution you'd like
Update our documentation to have more visuals to show how things tie within player. Especially around the Content section. How we take your content to how it shows up on the page. And what that content looks like in code to the rendered view.

Additional context

Create Jetpack Compose Reference Assets

Currently the Android assets only contain traditional Android view based assets.
Alongside the Composable player patternization, it would be good to have a ComposeReferenceAssetsPlugin containing the same reference assets but as composables using the following pattern

open class ComposableAsset<Data> constructor(assetContext: AssetContext, serializer: KSerializer<Data>, private val content: @Composable (AssetContext, Data) -> Unit) : DecodableAsset<Data>(assetContext, serializer) {
    override fun initView(): View = ComposeView(requireContext()).apply {
        setContent {
            content(assetContext, data)
        }
    }

    override fun View.hydrate() {
        require(this is ComposeView)

        setContent {
            content(assetContext, data)
        }
    }

    @Composable public fun compose() {
        content(assetContext, data)
    }
}

Assets should be rendered with the following compose function

@Composable
fun RenderableAsset.compose(modifier: Modifier = Modifier) {
    if (this is ComposableAsset<*>) Box(
        modifier,
        propagateMinConstraints = true,
    ) {
        compose()
    } else AndroidView(factory = ::FrameLayout, modifier) {
        assetContext.withContext(it.context).build().run { render() } into it
    }
}

Docs: Local dev requirements + setup

There are some docs on how to get started w/ bazel and running tests/builds locally in the CONTRIBUTING.md, but nothing around system requirements, etc

We should also add common snippets (run all js tests, start docs locally, etc)

Core: Transform reference action asset role

The reference react action asset currently renders a < icon when the value of the action indicates that the user would go backwards in the flow. Rather than have assets on each platform implement this check, we can move it into the transform and expose a generic property in the action metadata to make the coupling between icon and value looser.

  • Move logic for determining isBackAction into the action transform and populate a role property in the metaData when applicable.

  • Update the react asset to use metaData.role instead of checking the value directly.

1.0 Release Article

Intuit has a Medium blog for engineering related content, as a part of the 1.0 release, an article should be prepared for publishing to intro and give an overview of Player.

Android: Reusable sample app

Is your feature request related to a problem? Please describe.

When I write custom assets for my own project, there's no easy way to test them locally with sample Player content. What I end up doing often is copy-pasting almost the entire sample app module from the Player Android project, since the sample app is well put together. This is not a hard task, but it is tedious.

Describe the solution you'd like

It would be nice if the sample app can be extended in some way. Ideally, it should be flexible for

  • small and simple projects where I can plug in the sample app, throw some Player content in the assets folder, and see how they render
  • bigger projects where I can extend the sample app, customize it with additional asset functionalities to be demoed (like theme switching)
  • complex projects where Player is only one of the capabilities/screens to be demoed in the app

Additional context

Android: Info reference asset tablet layout

Depends on #164

Once segmented actions are available through the transform, we can add a tablet specific layout for the info reference asset that stacks the buttons horizontally, rather than vertically, with actions that would take the user back in the flow on the left and actions for advancing on the right.

Publish to Maven Central

The release only publishes docs right now, we need to publish to each package manager (npm, maven central)

Core: Transform Info asset actions

The reference react info asset segments actions based on their value, to display side by side in larger viewports.

To leverage this for tablet views in iOS and Android, we should move this segmentation logic to a transform. And remove the react specific code to leverage the transformed data.

iOS: Info reference asset iPad layout

Depends on #164

Once segmented actions are available through the transform, we can add an iPad specific layout for the info reference asset that stacks the buttons horizontally, rather than vertically, with actions that would take the user back in the flow on the leading edge of the screen, and actions for advancing at the trailing edge.

iOS: Action asset back icon

Depends on #169

In the iOS reference action asset

  • Render a < icon next to the label based on metaData.role
  • Do not render a button background when rendering the back icon, instead apply the background color to the text

Fix circle builds for forked PRs

Right now the remote caching is failing in circle for forked PRs due to a missing cache write token.

For forked PRs, we should allow cache reads, but disable writes

React: Create boiler plate templates for using player

Is your feature request related to a problem? Please describe.
Our previous react player template was using create-react-app which isn't used anymore. It would be nice to have a new up to date template that people can pull and work with player to test things out.

This can be used with vite, nextjs, etc.
I believe the only requirements would be that it must be on React 17.

Describe the solution you'd like

Goal: If people want to test using player, they should be able to easily pull this repo and enter their desired content and have it render on the screen.
Templates for custom assets to see how things are being rendered may help as well.
You can also write documentation on a Using/Getting Started with React Player Guide

Additional context

Add TSX support for content in Storybook

The storybook integration today allows the user to manually view/edit the JSON content that powers the flow on screen.

It would be great for users to be able to see the TSX structure of the same view, allowing them to quickly get started in a DSL based local environment.

Android: New Reference Asset - Choice

Depends on #181

Consuming the new core choice, provide a rendering implementation in Android that displays the asset a list of "tiles". While the React implementation will use radio buttons, that UX is not as ideal on mobile devices, and we should opt for slightly larger controls.

A "tile" can be described as follows:

  • A tile is a container with rounded corners, and a slight shadow to lift it off the content behind it
  • A tile that is currently selected has no shadow, and a green stroke around the border of the tile

For this choice asset:

  • Render the label of each choice entry inside each tile

  • Render the title of the choice above the list of tiles

  • Render validation information below the list of tiles

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.