wiki/new-feature-guide.md
For understanding the underlying architecture (backend runtime, frontend rendering, WebSocket communication, element tree), see the understanding-streamlit-architecture skill.
Most features need implementation in three areas:
lib/streamlit/frontend/proto/New features should include:
lib/testse2e_playwright/Protobuf changes in proto/ then run make protobuf
proto/streamlit/proto/Element.protoBackend in lib/streamlit/
lib/streamlit/__init__.pyst.* commands: decorate with gather_metrics. Use it only for those public APIs, not internal helpers.Python unit tests in lib/tests
uv run pytest lib/tests/streamlit/the_test_name.pylib/tests/streamlit/element_mocks.pyFrontend in frontend/
frontend/lib/src/components/core/Block/ElementNodeRenderer.tsxVitest tests in *.test.tsx
cd frontend && yarn test lib/src/components/elements/NewElement/NewElement.test.tsxE2E Playwright tests in e2e_playwright/
make run-e2e-test e2e_playwright/name_of_the_test.pyAutofix formatting and linting: make autofix
Verify the implementation: make check
Bundled agent skills (user-facing features): update lib/streamlit/.agents/skills/ following lib/streamlit/.agents/skills/AGENTS.md