Skip to content

Add Key Results tab (KR list + detail + data source config)#83

Closed
devin-ai-integration[bot] wants to merge 1 commit into
developfrom
devin/1781149785-key-results-tab
Closed

Add Key Results tab (KR list + detail + data source config)#83
devin-ai-integration[bot] wants to merge 1 commit into
developfrom
devin/1781149785-key-results-tab

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Adds a new Key Results tab as the first tab (index 0) in the side drawer, with full CRUD: a list view with mini sparkline charts, a detail/edit view with a bar chart (current week highlighted), data source configuration (API fetch with Keychain-stored bearer token), and manual weekly value entry.

Architecture at a glance

LoopIOS/KeyResults/
  KeyResult.swift           — model struct (Codable, weekly values)
  KeyResultStore.swift      — JSON file persistence (iCloud Documents, same container as ConversationFileStore)
  KeyResultKeychainHelper.swift — per-KR bearer token ↔ iOS Keychain
  KeyResultFetcher.swift    — async HTTP GET → [{ week, value }] parser
  KeyResultCell.swift       — drawer list cell (title + "Week N — value" + MiniBarChartView)
  KeyResultDetailVC.swift   — full-screen detail: editable fields, BarChartView, data source config, manual entry

Key decisions

  • Persistence: single key_results.json in the same iCloud Documents container the conversation store uses. Atomic rewrite (dataset is small).
  • Bearer token: stored in iOS Keychain via KeyResultKeychainHelper (service com.bhat.intel.keyresults, account = KR UUID). Never written to the JSON file.
  • Bar chart: hand-rolled UIView (no SwiftUI Charts dependency) — BarChartView in the detail, MiniBarChartView in the cell.
  • Drawer tab order: ["Key Results", "Conversations", "Files", "Skills"] (indices 0/1/2/3). Segment restore and NavigationSkill routing updated accordingly.
  • iOS only: new files excluded from macOS and visionOS targets via membershipExceptions.

Implemented

  • Key Results tab at index 0 in the drawer
  • "+" button to create a new KR
  • KR list with title, current week value, mini bar chart
  • KR detail with bar chart (current week in orange)
  • Editable title, metric name
  • Data source config (API URL, SecureField bearer token, "Fetch now")
  • Expected response spec documented in-view
  • Manual weekly value add/update
  • Swipe-to-delete on KR rows
  • NavigationSkill supports keyresults / kr panel/tab

Explicitly deferred (v2)

  • Multi-user / sync
  • Agent binding / sub-agent automation
  • Analytics, comments, sub-tasks
  • macOS / visionOS surfaces

Link to Devin session: https://app.devin.ai/sessions/8b15efc191904095a8e20d6e1535878b

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author
Original prompt from API User

Add a new "Key Results" feature to the LoopHarness iOS app.

Repository: https://github.com/theashbhat/LoopHarness

#``# Scope

#``#``# 1. Side Drawer — add a new tab at index 0

The side drawer currently has tabs for Conversations, Files, and Skills. Add a new Key Results tab as the FIRST tab (index 0). After this change the drawer order should be:

  1. Key Results (new)
  2. Conversations
  3. Files
  4. Skills

#``#``# 2. Key Results tab UI

  • Wrap the tab's content in a SwiftUI NavigationStack (or the equivalent pattern already used in the codebase for the other drawer tabs — match existing conventions).
  • The root view of the stack has a navigation bar with:
    • A segmented control in the nav bar (match the segmented-control pattern used elsewhere in Loop — e.g. on the model picker or wherever the codebase already does this). For v1, a single segment ("All") is fine; the structure must support adding more later.
    • A leading nav bar button: a + icon. Tapping it creates a new Key Result (push a "New KR" form view onto the stack, or present a sheet — match the codebase's convention for similar create flows).
  • Below the nav bar, a table / list of KR cells. Each cell displays:
    • KR title (e.g. "EOB Backlog to Zero")
    • Current week's value (e.g. "Week 6 — 11,000")
    • A compact mini bar chart of weekly values, or at minimum a sparkline-style preview.
  • Tapping a cell pushes a detail view onto the NavigationStack.

#``#``# 3. KR Detail view

The detail view shows one KR in full:

  • Title at the top.
  • Header line: current week label + value, e.g. "Week 6 — 11,000".
  • Bar chart below the header: one bar per week of the quarter so far (weeks 1 through current week). Each bar is labeled with its value. The current week's bar should be visually distinguished (different fill / outline). Use SwiftUI Charts if available in the project's deployment target; otherwise hand-roll a simple bar chart.
  • Metric name field (the human-readable n... (2358 chars truncated...)

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
loop-harness Ready Ready Preview, Comment Jun 11, 2026 6:43pm

- Add KeyResult data model with weekly values and Keychain-backed
  bearer token storage (KeyResultKeychainHelper)
- Add KeyResultStore for JSON file persistence (iCloud Documents,
  matching ConversationFileStore's pattern)
- Add KeyResultFetcher for fetching values from a configured HTTP API
- Insert Key Results as the first tab (index 0) in SideDrawerViewController
- Implement KeyResultCell with title, current value, and mini bar chart
- Implement KeyResultDetailVC with:
  - Editable title and metric name
  - Full bar chart (current week highlighted in orange)
  - Data source config (API URL, SecureField for bearer token, Fetch button)
  - Manual weekly value entry
- Update NavigationSkill to support 'keyresults' panel navigation
- Exclude KeyResults/ from macOS and visionOS targets (iOS only)

Co-Authored-By: bot_apk <apk@cognition.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant