gradio/js
Hannah 5181957706
Add mobile Chromatic tests (#7222)
* Add mobile story tests

* add layout stories

* add changeset

* configure viewports

* formatting

* Remove tablet stories + add plot story

* add changeset

* add mobile tests to layout stories

* fix story

* fix story

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: pngwn <hello@pngwn.io>
2024-02-02 14:21:48 +00:00
..
_cdn-test chore(deps): update all non-major dependencies (#6537) 2023-11-22 18:04:27 -05:00
_spaces-test Version 4 development branch (#5498) 2023-10-31 04:46:02 +00:00
_website Document the gr.ParamViewer component, and fix component preprocessing/postprocessing docstrings (#7116) 2024-01-31 09:36:21 -08:00
accordion Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
annotatedimage chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
app Few File component drag and drop (#7141) 2024-01-31 16:23:11 -05:00
atoms chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
audio Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
box chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
button chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
chatbot Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
checkbox Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
checkboxgroup chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
code Small cleanups of Code component (#7240) 2024-01-31 14:47:18 -08:00
colorpicker Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
column Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
dataframe Allow selecting texts in dataframe cells (#7154) 2024-01-29 16:51:46 -08:00
dataset Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
dropdown Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
fallback chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
file Fix single file upload display (#7221) 2024-01-30 15:05:33 -05:00
fileexplorer Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
form chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
gallery Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
group Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
highlightedtext chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
html chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
icons chore: update versions (#6670) 2023-12-12 18:32:54 -08:00
image Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
imageeditor Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
json chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
label chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
lite chore: update versions (#7002) 2024-01-10 15:31:28 -08:00
markdown Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
model3D Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
number Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
paramviewer chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
plot Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
preview Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
radio Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
row Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
simpledropdown Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
simpleimage Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
simpletextbox Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
slider chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
state chore: update versions (#6039) 2023-10-31 13:20:18 +00:00
statustracker chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
storybook Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
tabitem Add visible check to Tab (#7220) 2024-01-30 18:34:53 +00:00
tabs chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
textbox Handle the case where examples is null for all components (#7192) 2024-01-29 16:51:22 -08:00
theme chore: update versions (#6039) 2023-10-31 13:20:18 +00:00
tooltip chore: update versions (#6039) 2023-10-31 13:20:18 +00:00
tootils chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
upload Few File component drag and drop (#7141) 2024-01-31 16:23:11 -05:00
uploadbutton chore: update versions (#7083) 2024-01-25 16:10:24 -08:00
utils chore: Change time format (#7274) 2024-02-01 13:23:19 -08:00
video Add mobile Chromatic tests (#7222) 2024-02-02 14:21:48 +00:00
wasm Update ruff to 0.1.13, enable more rules, fix issues (#7061) 2024-02-01 11:32:40 -08:00
.npmrc
jsx.d.ts
README.md

gradio-ui

This folder contains all of the Gradio UI and component source code.

setup

This folder is managed as 'monorepo' a multi-package repository which make dependency management very simple. In order to do this we use pnpm as our package manager.

Make sure pnpm is installed by following the installation instructions for your system.

You will also need node which you probably already have

running the application

Install all dependencies:

pnpm i

This will install the dependencies for all packages and link any local packages

local development

To develop locally, open two terminal tabs from the root of the repository.

Run the python test server, from the root directory:

cd demo/kitchen_sink
python run.py

This will start a development server on port 7860 that the web app is expecting.

Run the web app:

pnpm dev

building for production

Run the build:

pnpm build

This will create the necessary files in js/app/public and also in gradio/templates/frontend.

quality checks

The repos currently has two quality checks that can be run locally and are run in CI.

formatting

Formatting is handled by prettier to ensure consistent formatting and prevent style-focused conversations. Formatting failures will fails CI and should be reoslve before merging.

To check formatting:

pnpm format:check

If you have formatting failures then you can run the following command to fix them:

pnpm format:write

type checking

We use TypeScript to provide static types to javascript code. These checks are also run in CI.

to typecheck the code:

pnpm ts:check

ci checks

Currently the following checks are run in CI:

static checks

  • Format check (pnpm format:check)
  • Build css (pnpm css)
  • Build client (pnpm build)
  • Type check (pnpm ts:check)
  • Unit tests (pnpm test:run)

functional test

pip install -r demo/outbreak_forecast/requirements.txt
pnpm exec playwright install chromium
pnpm exec playwright install-deps chromium
pnpm test:browser:full