← Back to case studies

Case study · Microsoft Developer Division

AI Code Flow

An intelligent coding assistant that lives inside the editor, moving from reactive autocomplete to proactive, context-aware intent prediction.

Role
Product Designer
Team
Microsoft Developer Division, AI Tooling
Platform
Code editors
Focus
AI interaction, safety, telemetry

01

Project overview and role

Role
Product Designer in Microsoft's Developer Division, on the AI Tooling team.
Scope
End-to-end UX architecture, interaction paradigms, safety guardrails, and the telemetry framework used to evaluate AI Code Flow.
Core objective
Design an intelligent coding assistant that fits seamlessly into code editors. It shifts from reactive autocomplete to proactive, context-aware intent prediction, while guarding against hallucinations, security vulnerabilities and workflow fatigue.

Interactive prototype

The Code Flow workspace

Accept or reject the inline suggestion, swap the deprecated API, open the refactor prompt with Ctrl I (Cmd I on a Mac), review the diff, and move between Home, Flows, Archive and Settings. Dark mode is the default; switch to light mode from the sidebar or Settings.

API client retry logic

Guardrails active
acme/platformsrc/client/api-client.ts
Ln 48, Col 3
export async function request<T>(
url: string,
options: RequestOptions,
): Promise<T> {
const response = await fetch(url, options)
 
if (!response.ok) {
throw new ApiError(response)
}
 
+const retryPolicy = createRetryPolicy({
+maxAttempts: 3,
+retryOn: isTransientFailure,
+backoff: exponentialBackoff({ baseMs: 200 }),
+})
 
+return retryPolicy.execute(() => parseResponse<T>(response))
Code Flow suggestion
}
 
// Existing behavior for non-retryable errors is preserved.
Deprecated internal API

AuthServiceV1 is deprecated in the monorepo root. Use the approved V2 wrapper.

Telemetry validator
code-flow/api-retries TypesLintLicense TypeScript · UTF-8

02

The problem space: the cost of context switching and non-determinism

Modern enterprise developers spend more time navigating legacy codebases, managing dependency trees and writing boilerplate than solving core architectural problems. Generative AI offered a powerful way to accelerate code creation, but early tools introduced severe UX friction.

The sidebar trap
Forcing developers to break their gaze from the editor, copy and paste snippets from a chat pane, and manually refactor imports broke deep cognitive focus.
Non-determinism anxiety
Developers are trained to trust deterministic systems such as compilers and linters. LLMs are probabilistic. A generated block can look syntactically correct while introducing subtle security flaws, memory leaks or deprecated API calls.
Context blindness
Generic models lacked deep awareness of local monorepo architecture, internal security wrappers and proprietary libraries, and frequently generated hallucinated internal package references.

05

Collaboration and enterprise governance

Designing for enterprise teams meant balancing individual velocity with organizational governance. We introduced workspace-level configuration controls.

Telemetry and compliance dashboards
Engineering leads get visibility into code acceptance rates, license compliance scanning (so no GPL code slips into proprietary enterprise repositories) and token latency metrics.
Custom context tagging
Teams can @mention specific internal documentation directories or architecture RFCs directly in the prompt flow, grounding model output in verified institutional knowledge.

06

Design system token architecture for high density

To support rapid theme switching (dark, light and high contrast), variable window sizes and extreme layout compaction without brittle hardcoded values, we built a three-tier token architecture.

Tier 1

Global (primitive) tokens

Raw foundational values: hex codes, base spacing units and raw font scales. In developer tools the spacing scale has to reach down to micro-increments to support tight tree views and dense status bars.

Spacing scale
A 4px base grid with micro-steps: space-0.5 (2px), space-1 (4px), space-2 (8px) and up.
Color primitives
Raw palette scales such as slate-900 and blue-500, used only as source values for semantic tokens.

Tier 2

Semantic (alias) tokens

Tokens mapped to specific interface intents. They decouple the raw value from its use, which makes dark and light inversion seamless and lets the theme extend to match VS Code or JetBrains themes.

Surface
surface.editor, surface.sidebar, surface.hover, surface.active
Border and divider
border.subtle for nested tree lines, border.focused, border.error
Text and icon
text.primary, text.secondary, text.muted, text.accent

Tier 3

Component and density multiplier tokens

High-density interfaces need an extra layer of structural abstraction: density context modifiers. Instead of building separate components for compact and comfortable modes, token sets adjust through a single root density multiplier.

Token categoryComfortable modeCompact / high-density modeArchitectural purpose
Row height28px20px–22pxMaximizes visible tree rows and log lines in file explorers and debuggers.
Inline padding8px (space-2)4px (space-1)Minimizes horizontal footprint in narrow sidebars and tabs.
Font size (UI)13px11px–12pxPreserves hierarchy while fitting rich metadata into tight columns.
Border radius4px2px or 0pxPrevents sub-pixel rendering blur in ultra-dense grids and tight button groups.

Syntax scope tokenization

Unlike standard web apps, developer tools need to keep UI chrome tokens separate from syntax highlighting tokens. Syntax tokens map directly to abstract syntax tree (AST) node types, such as syntax.keyword, syntax.string, syntax.function.declaration and syntax.variable.builtin. This lets theme authors style language constructs independently of UI containers.

07

Accessibility in high-density contexts

Information-dense developer tools raise accessibility challenges that most products never meet: small type sizes, complex keyboard navigation models, and non-deterministic UI updates such as AI code generation streams.

Contrast ratios for small type (11px–12px)

WCAG 2.1 requires a contrast ratio of 4.5:1 for normal text and 3:1 for large text. At 11px and 12px monospaced sizes, though, standard semantic grey text (text.muted) can easily become illegible when anti-aliasing thins the strokes.

Muted text audit
We audited muted text tokens specifically against dark editor backgrounds (surface.editor). Secondary metadata such as line numbers and git timestamps keeps a minimum contrast ratio of 4.6:1, instead of slipping into low-contrast greys that cause eye strain over long coding sessions.
Error and state indicators
Color is never the only signal for syntax errors or lint warnings. Wavy amber and red underlines are always paired with distinct icon glyphs or gutter markers, so color-blind developers get the same information.

Assistive tech and non-deterministic UX

Real-time generative features such as multi-line ghost text, inline diffs and streaming completion chips can easily overwhelm or disorient screen reader users.

Ghost text and inline diffs
Ghost text (ambient inline completions) is never announced character by character as it streams in, which would create intolerable auditory chatter. Instead, aria-live="polite" is applied selectively to container regions, only once a suggestion is fully rendered and ready for review, or when the user asks for it with a shortcut: “AI suggestion available: 3 lines. Press Tab to accept.”
Diff view accessibility
Side-by-side and inline diffs use semantic table or list structure, with explicit aria-label attributes on added (ins) and deleted (del) lines. Screen readers then describe token changes clearly instead of reading raw, unformatted blocks of text.