Skip to content

Add android contributing documentation#342

Open
Falah-Zaidan wants to merge 3 commits intomainfrom
add-android-source-documentation
Open

Add android contributing documentation#342
Falah-Zaidan wants to merge 3 commits intomainfrom
add-android-source-documentation

Conversation

@Falah-Zaidan
Copy link
Member

Description

This PR adds documentation on how to contribute to the repository (android)

@Falah-Zaidan Falah-Zaidan added the documentation Improvements or additions to documentation label Mar 10, 2026
@Falah-Zaidan Falah-Zaidan requested a review from a team as a code owner March 10, 2026 12:32
@Falah-Zaidan Falah-Zaidan added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Mar 10, 2026
Copilot AI review requested due to automatic review settings March 10, 2026 12:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Android-facing contribution documentation for adding new design-system components, and links it from the Android README.

Changes:

  • Add a new guide: android/docs/adding_source_components.md with step-by-step component addition flow.
  • Add a “Contributing” section to android/README.md linking to the new guide.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
android/docs/adding_source_components.md New documentation describing the process to add Source components.
android/README.md Adds a Contributing link pointing to the new documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +16 to +27
- foundation contains icons (for icons), palette (for colours) and typography (for fonts and text styles).
- components contains the UI components that we can use in our apps (from the Figma apps library).
- daynight contains our `AppColourMode` wrapper for dark mode, which composable heirarchies should be wrapped in to enable dark mode support.

### 2. Code implementation

**Overview**

To implement a new component from the Figma Apps Library or core library, there are three steps
1) Create the component (composable, preview and snapshot test)
2) Add it to the sample (nav graph)
3) Create or update the README and link from root README
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These list items are indented by 4 spaces, which renders as a code block in Markdown rather than a bulleted list. Remove the extra indentation (or use a proper nested list) so the repository structure renders correctly.

Suggested change
- foundation contains icons (for icons), palette (for colours) and typography (for fonts and text styles).
- components contains the UI components that we can use in our apps (from the Figma apps library).
- daynight contains our `AppColourMode` wrapper for dark mode, which composable heirarchies should be wrapped in to enable dark mode support.
### 2. Code implementation
**Overview**
To implement a new component from the Figma Apps Library or core library, there are three steps
1) Create the component (composable, preview and snapshot test)
2) Add it to the sample (nav graph)
3) Create or update the README and link from root README
- foundation contains icons (for icons), palette (for colours) and typography (for fonts and text styles).
- components contains the UI components that we can use in our apps (from the Figma apps library).
- daynight contains our `AppColourMode` wrapper for dark mode, which composable heirarchies should be wrapped in to enable dark mode support.
### 2. Code implementation
**Overview**
To implement a new component from the Figma Apps Library or core library, there are three steps
1) Create the component (composable, preview and snapshot test)
2) Add it to the sample (nav graph)
3) Create or update the README and link from root README

Copilot uses AI. Check for mistakes.
In the `source` module, note the folders components, foundation and daynight.
- foundation contains icons (for icons), palette (for colours) and typography (for fonts and text styles).
- components contains the UI components that we can use in our apps (from the Figma apps library).
- daynight contains our `AppColourMode` wrapper for dark mode, which composable heirarchies should be wrapped in to enable dark mode support.
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: “heirarchies” should be “hierarchies”.

Suggested change
- daynight contains our `AppColourMode` wrapper for dark mode, which composable heirarchies should be wrapped in to enable dark mode support.
- daynight contains our `AppColourMode` wrapper for dark mode, which composable hierarchies should be wrapped in to enable dark mode support.

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +72
```kotlin
@Composable
fun MyNewComponentPreview(onBack: () -> Unit) {
MyNewComponent(text = "Hello, World!")
}
```

- Add a snapshot test for the component (in a mirroring directory in the test directory):

```kotlin
@Test
fun newComponent() {
paparazzi.snapshot {
NewComponentPreview()
}
}
```

- Add a serializable destination for it in `Destination.kt`:

```kotlin
@Serializable
object NewComponentPreview : Destination
```

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example code is internally inconsistent: it defines MyNewComponentPreview(onBack: () -> Unit) but later snapshots/calls NewComponentPreview() and also introduces a Destination object with the same name. Please make the example names consistent and ensure the preview/test snippets would compile if copied.

Copilot uses AI. Check for mistakes.
**[Full API documentation is available here.](https://guardian.github.io/source-apps/android/docs/index.html)**

## Contributing
If you want to add new components to the Source library, please follow the guide in [Adding Source components](https://github.com/guardian/source-apps/blob/main/android/docs/adding_source_components.md).
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link hardcodes blob/main, which breaks for forks/branches and when viewing the README locally. Prefer a relative link to docs/adding_source_components.md (similar to the other relative links in this README).

Suggested change
If you want to add new components to the Source library, please follow the guide in [Adding Source components](https://github.com/guardian/source-apps/blob/main/android/docs/adding_source_components.md).
If you want to add new components to the Source library, please follow the guide in [Adding Source components](docs/adding_source_components.md).

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,89 @@
# Adding Source Components

Developers may wish to add components to our design system for use throughout the app. We have a separate repository for this called `source-apps`, which contains the Android and iOS components from a core library defined in Figma. The process to add components is outlined there, but is also here for reference.
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc says there is a “separate repository” called source-apps, but this file lives inside the source-apps repo. Please reword to avoid implying contributors should look elsewhere, and describe the modules within this repository instead.

Suggested change
Developers may wish to add components to our design system for use throughout the app. We have a separate repository for this called `source-apps`, which contains the Android and iOS components from a core library defined in Figma. The process to add components is outlined there, but is also here for reference.
Developers may wish to add components to our design system for use throughout the app. This repository, `source-apps`, contains the Android and iOS components derived from our core libraries defined in Figma. The process to add components to these modules is outlined below for reference.

Copilot uses AI. Check for mistakes.
- components contains the UI components that we can use in our apps (from the Figma apps library).
- daynight contains our `AppColourMode` wrapper for dark mode, which composable heirarchies should be wrapped in to enable dark mode support.

### 2. Code implementation
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The section numbering is inconsistent: this is the second “### 2.” heading under “Outline”. Please renumber this section (and any subsequent references) to keep the outline unambiguous.

Suggested change
### 2. Code implementation
### 3. Code implementation

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants