---
title: "Macramé: Untangling the Knot on the Etsy Android Listing Screen"
description: "Etsy rewrote its 4000-line Android listing Fragment into Macramé, a Mobius-inspired unidirectional architecture: a single immutable State exposed via StateFlow, flattened into small UI models rendered by a RecyclerView with ListAdapter diffing, and a sealed-class Event dispatcher routing actions to single-purpose Handlers that update State, launch async work, or emit SideEffects to the Fragment."
url: "https://swe.quest/articles/macrame-untangling-the-knot-on-the-etsy-android-listing-screen-4979a6b6f6a452f8"
canonical: "https://www.etsy.com/codeascraft/macrame-untangling-the-knot-on-the-android-listing-screen"
source: "Etsy Code as Craft"
published: "2024-03-18"
difficulty: "medium"
kind: "Case study"
reading_minutes: 7
tags: ["mobile","jvm","refactoring","testing","performance"]
---

# Macramé: Untangling the Knot on the Etsy Android Listing Screen

A post on [Etsy Code as Craft](https://swe.quest/sources/etsy.md), published 2024-03-18, 7 min read, Case study. Original: [https://www.etsy.com/codeascraft/macrame-untangling-the-knot-on-the-android-listing-screen](https://www.etsy.com/codeascraft/macrame-untangling-the-knot-on-the-android-listing-screen)

## Summary

Etsy rewrote its 4000-line Android listing Fragment into Macramé, a Mobius-inspired unidirectional architecture: a single immutable State exposed via StateFlow, flattened into small UI models rendered by a RecyclerView with ListAdapter diffing, and a sealed-class Event dispatcher routing actions to single-purpose Handlers that update State, launch async work, or emit SideEffects to the Fragment. The five-month rewrite cut Time to First Content by 18% (1585 ms to 1298 ms), lifted listing views, add-to-carts and searches in an A/B test, and raised business-logic unit test coverage from single digits to 76%. Remaining tradeoffs include Event/Handler wiring boilerplate, harder debugging of Handler-dispatched event chains, and overkill on simple screens.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)
- [Java & JVM](https://swe.quest/tags/jvm.md) (Languages)
- [Refactoring & migrations](https://swe.quest/tags/refactoring.md) (Engineering practices)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- Android development ([easy posts on Mobile](https://swe.quest/tags/mobile.md?difficulty=easy))
- Kotlin basics ([easy posts on Java & JVM](https://swe.quest/tags/jvm.md?difficulty=easy))
- RecyclerView
- Kotlin Flow ([easy posts on Java & JVM](https://swe.quest/tags/jvm.md?difficulty=easy))

## Keywords

Macramé, Etsy, Android, Kotlin, StateFlow, RecyclerView, Mobius, Jetpack Compose

## Related posts

- [Adopting Jetpack Compose for Etsy’s Android App](https://swe.quest/articles/adopting-jetpack-compose-for-etsy-s-android-app-07407ea696750e78.md): Etsy Code as Craft · 2025-01-28 · Medium · 6 min read · Mobile, Refactoring & migrations, Design systems, Java & JVM, Frontend
  Etsy adopted Jetpack Compose as its preferred Android UI toolkit through a staged rollout.
- [Instant Performance Upgrade: From FlatList to FlashList](https://swe.quest/articles/instant-performance-upgrade-from-flatlist-to-flashlist-c3a0da3f6c5f1429.md): Shopify Engineering · 2022-08-17 · Easy · 8 min read · React, Mobile, Performance engineering, Open source
  FlashList is Shopify's open-source drop-in replacement for React Native's FlatList.
- [Management of Native Code and React Native at Shopify](https://swe.quest/articles/management-of-native-code-and-react-native-at-shopify-a1da81505efaf180.md): Shopify Engineering · 2021-04-16 · Medium · 8 min read · Mobile, React, Java & JVM, Performance engineering
  Shopify's Point of Sale team kept complex UI such as a draggable, reorderable grid of hundreds of buttons in React Native, fixing performance with fewer re-renders, lazy rendering, memoization and Reanimated 2.
- [Transitioning to Appcraft: Evolution of Zalando’s server-driven UI framework](https://swe.quest/articles/transitioning-to-appcraft-evolution-of-zalando-s-server-driven-ui-framework-47edf47ff02f2cb4.md): Zalando Engineering · 2024-05-15 · Medium · 11 min read · Mobile, System design, Frontend, Deployment
  Zalando replaced its Truly Native Apps (TNA) framework, whose fixed, versioned composite tiles forced client releases for small UI changes, with Appcraft, a server-driven UI framework built on an Elm-style unidirectional architecture and Flexbox layout.
- [Zed Weekly: #25](https://swe.quest/articles/zed-weekly-25-cd3a5f41d4f0b187.md): Zed · 2023-11-03 · Medium · 6 min read · Rust, Frontend, Refactoring & migrations, Developer tools
  Zed is rewriting its UI framework as GPUI 2 and porting the whole editor onto it before open-sourcing, trading feature work for better ergonomics while keeping GPUI 1's performance.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
