Skip to content

feat: S-4.2.2 Collapsed Iterations UI (history view, expanded tabs, range selection)#408

Open
pedropaulovc wants to merge 18 commits into
mainfrom
feature/collapsed-history-view
Open

feat: S-4.2.2 Collapsed Iterations UI (history view, expanded tabs, range selection)#408
pedropaulovc wants to merge 18 commits into
mainfrom
feature/collapsed-history-view

Conversation

@pedropaulovc

@pedropaulovc pedropaulovc commented Feb 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • AC-4.2.2.3: Click collapsed group tab to open a history view showing discarded commits (revision, message, author, date) with an eraser icon header
  • AC-4.2.2.4: "Include discarded iterations" button expands the collapsed group, replacing the single tab with individual grayed-out tabs
  • AC-4.2.2.5: Expanded discarded tabs render at 0.6 opacity, visually distinct from live tabs (1.0 opacity)
  • AC-4.2.2.6: Expanded discarded tabs participate in drag-to-select range diffs, including cross-boundary selection spanning discarded and live iterations
  • AC-4.2.2.8: GC'd commits (garbage-collected before SHA) show "Unknown iterations were discarded" message; unavailable tabs rendered at 0.4 opacity with aria-disabled

Changes

  • New component: CollapsedIterationHistoryView — renders discarded commit details with include button
  • Store: Added activeCollapsedGroupId, selectCollapsedGroup, clearCollapsedGroup, toggleCollapsedGroupVisibility actions
  • IterationSelector: Collapsed tab changed from <div> to <button>, expanded groups render individual discarded/unavailable tabs
  • DiffView: History view integration as independent early return (before PR description check)
  • CSS: 10 new classes for discarded tabs, unavailable tabs, and history view layout

Test plan

  • 9 new store unit tests (selectCollapsedGroup, clearCollapsedGroup, toggleCollapsedGroupVisibility, selectRange clears, reset clears)
  • 6 new CollapsedIterationHistoryView unit tests (commit list, include button, unavailable row, unknown count)
  • 7 new IterationSelector unit tests (button element, click handler, expanded rendering, drag range, unavailable tab)
  • 5 new E2E tests: collapsed-iterations-ui.spec.ts (history view, include button, unknown count, dismiss, truncation)
  • 5 new E2E tests: collapsed-iterations-expanded.spec.ts (expand tabs, drag range, unavailable CSS, discarded opacity, click-to-select)
  • All 1476 unit tests pass, all 125 E2E tests pass
  • Manual demo verified all ACs with screenshots (spec/demo/s-4.2.2-collapsed-iterations-ui.md)

🤖 Generated with Claude Code


🔍 Review in CodjiFlo

Copilot AI review requested due to automatic review settings February 18, 2026 20:23
@github-actions

github-actions Bot commented Feb 18, 2026

Copy link
Copy Markdown

CodjiFlo Iteration Tracking

Iterations captured: 8
Last updated: 2026-04-04T07:17:10.000Z
Artifact: 6269477194
Run ID: 23973895418


What is this?

This comment is automatically updated by the CodjiFlo GitHub Action to enable force-push resilient code review with iteration tracking.

The artifact referenced above contains iteration data that the CodjiFlo frontend uses to:

  • Track code changes across force-pushes
  • Enable comment persistence across code modifications
  • Allow comparison between any two iterations

@github-actions

github-actions Bot commented Feb 18, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 75.61% (🎯 70%)
⬆️ +0.67%
3107 / 4109
🟡 Statements 74.38% (🎯 70%)
⬆️ +0.68%
3255 / 4376
🟡 Functions 72.79% (🎯 70%)
⬆️ +0.62%
645 / 886
🟡 Branches 71.56% (🎯 70%)
⬆️ +0.49%
1913 / 2673
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/features/diff/components/DiffView.tsx 77.08%
⬇️ -2.69%
64.17%
⬇️ -3.62%
63.15%
⬇️ -7.43%
80.89%
⬇️ -3.25%
73-84, 97-99, 166, 206, 210-218, 372-373
src/features/iterations/timeline-loader.ts 100% 95.65% 100% 100%
src/features/iterations/types.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/features/iterations/components/CollapsedIterationHistoryView.tsx 100% 90% 100% 100%
src/features/iterations/components/IterationSelector.tsx 100%
🟰 ±0%
96.9%
⬇️ -0.20%
100%
🟰 ±0%
100%
🟰 ±0%
src/features/iterations/stores/useIterationStore.ts 84.67%
⬆️ +1.85%
69.62%
⬆️ +2.41%
93.75%
⬆️ +2.85%
85.83%
⬆️ +1.62%
233-234, 240-241, 331, 334, 353, 357, 370-386, 416, 428, 436
Generated in workflow #1003 for commit fa38420 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Feb 18, 2026

Copy link
Copy Markdown

Preview Deployment

🚀 Preview: https://pr-408.codjiflo.vza.net/pedropaulovc/codjiflo/408

Updated for commit fa38420

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds stateless-mode UX for viewing and expanding “collapsed” (force-push-discarded) iterations, including a history view and expanded discarded/unavailable tabs that integrate with range selection.

Changes:

  • Introduces a CollapsedIterationHistoryView and store state/actions to select/clear/toggle collapsed iteration groups.
  • Updates IterationSelector to render collapsed groups as clickable buttons, expand groups into discarded/unavailable iteration tabs, and include them in drag-range selection.
  • Adds styling + unit/E2E test coverage for the new collapsed/expanded iteration behaviors.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/styles/shared/features.css Adds styling for discarded/unavailable tabs and the history view layout.
src/features/iterations/types.ts Extends iteration store state/actions to support a selected collapsed group.
src/features/iterations/stores/useIterationStore.ts Implements collapsed-group selection and visibility toggling; clears history view on range/preset changes.
src/features/iterations/stores/useIterationStore.test.ts Adds unit tests for new collapsed-group store behaviors.
src/features/iterations/index.ts Exports the new history view component from the feature barrel.
src/features/iterations/components/index.ts Re-exports CollapsedIterationHistoryView.
src/features/iterations/components/IterationSelector.tsx Makes collapsed group tab interactive; supports expanded discarded/unavailable tabs + range selection.
src/features/iterations/components/IterationSelector.test.tsx Updates/extends unit tests for the new selector behaviors.
src/features/iterations/components/CollapsedIterationHistoryView.tsx New component rendering discarded commit details and an “Include discarded iterations” action.
src/features/iterations/components/CollapsedIterationHistoryView.test.tsx Unit tests for history view rendering and behaviors.
src/features/diff/components/DiffView.tsx Integrates history view as an early-return overlay while keeping iteration selector visible.
e2e/mock/stateless-mode/collapsed-iterations-ui.spec.ts New E2E coverage for opening/dismissing the history view and unknown-count messaging.
e2e/mock/stateless-mode/collapsed-iterations-expanded.spec.ts New E2E coverage for expanding groups into tabs, range selection, and styling expectations.
e2e/fixtures/force-push-helpers.ts Adds shared E2E helpers to reduce duplication across new specs.

Comment thread src/styles/shared/features.css
Comment thread src/features/iterations/components/IterationSelector.tsx Outdated
Comment thread e2e/mock/stateless-mode/collapsed-iterations-expanded.spec.ts Outdated
pedropaulovc and others added 18 commits April 4, 2026 00:08
…ry view (AC-4.2.2.3, AC-4.2.2.4)

Store: add activeCollapsedGroupId, selectCollapsedGroup, clearCollapsedGroup,
toggleCollapsedGroupVisibility actions. selectRange and reset clear the active
collapsed group.

UI: CollapsedGroupTab changed from <div> to <button>, role="img" removed,
onClick calls selectCollapsedGroup. New CollapsedIterationHistoryView component
shows commit list, multi-line message truncation, unavailable commit handling,
unknownCount message, and Include button. IterationSelector respects group
visibility (expanded groups show individual tabs). DiffView shows history view
when a collapsed group is active.

Test validation: E2E tests confirmed RED before implementation, GREEN after.
5/5 E2E tests pass. 68 unit tests pass (31 store + 31 selector + 6 history view).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix 1: History view now shows regardless of current file selection by
moving the activeCollapsedGroupId check before the isShowingDescription
block instead of nesting inside it.

Fix 2: selectPreset now clears activeCollapsedGroupId to dismiss
history view when a preset range is selected.

Fix 3: Simplified redundant null check — activeCollapsedGroup is only
truthy when activeCollapsedGroupId is truthy.

Added unit test: selectPreset clears activeCollapsedGroupId.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…oups (AC-4.2.2.5, AC-4.2.2.6, AC-4.2.2.8)

When collapsed groups are expanded via Include button, individual
iteration tabs now render with 'discarded' CSS class (opacity 0.6).
Discarded tabs fully participate in drag range selection and click
interactions. Added CSS classes for discarded and unavailable states.

Test failure validated: before this change, expanded iterations rendered
as regular tabs without the discarded class, causing 4 E2E test
failures (opacity assertions, class assertions, range selection tests).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…efaults (AC-4.2.2.8)

Add isUnavailable prop to IterationTab: applies .unavailable CSS class,
aria-disabled="true", and removes all mouse/keyboard handlers making
the tab completely non-interactive. Cross-reference iteration headSha
with group's DiscardedCommit entries to determine availability status.
Fix isDiscarded/isUnavailable to use explicit default values (= false).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- DiffView.tsx: remove non-null assertion by capturing groupId in local
  const before the truthy check block
- collapsed-iterations-ui.spec.ts: replace raw locator with getByTestId
  regex to satisfy playwright/no-raw-locators rule
- collapsed-iterations-expanded.spec.ts: fix window casts by going
  through unknown first to satisfy strict TypeScript

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…action

1. Extract duplicated mockPR, mockFiles, config, setupForcePushScenario,
   and beforeEach setup from both collapsed-iterations spec files into
   e2e/fixtures/force-push-helpers.ts. Both specs now import shared
   helpers, eliminating ~100 lines of duplication per file.

2. Add JSDoc comment to clearCollapsedGroup action explaining it exists
   for future "dismiss without expanding" UX (no current callers).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
setupIterationMocks (called by setupFullPRMocks) only mocked the issue
comments and actions/artifacts endpoints for artifact discovery. The
stateless iteration fallback in loadIterations also calls the Timeline
and Commits APIs, which were left unmocked.

Under concurrent test execution, when a test logs in with a mock PAT
token, loadIterations re-fires with the token attached. The unmocked
timeline/commits requests leak to the real GitHub API, which returns
401 "Bad credentials" — causing browser console errors that fail
assertion checks in authentication-redirect.spec.ts.

Root cause confirmed via trace analysis: requests to /issues/*/timeline
and /pulls/*/commits returned 401 on the second (authenticated) page
load. Fix adds empty-response mocks for both endpoints.

Verified: 10/10 stress test passes (was 8/10 before fix).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use `disabled` attribute instead of `aria-disabled` on unavailable
  iteration tabs for proper HTML semantics and assistive tech support
- Remove `pointer-events: none` from `.iteration-tab.unavailable` CSS
  (contradicts `cursor: not-allowed` which needs pointer events to show)
- Remove conditional handler suppression (disabled buttons don't fire)
- Add comment explaining index coupling safety in history view
- Rename E2E test to clarify it validates CSS rule definition

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Recreated demo assets showing collapsed iterations UI:
- Default state with collapsed group tab
- History view with discarded commit details
- Expanded individual tabs at reduced opacity
- Cross-boundary range selection
- Unknown iterations (GC'd SHA) edge case

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document pedropaulovc/codjiflo-e2e-test-repo as the dedicated repo for
prod-mode E2E test data and demo-presenter agent workflows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The GitHub Timeline API's head_ref_force_pushed events only provide
commit_id (the new HEAD after force-push), not before_commit/after_commit.
Infer the "before" SHA by walking committed events chronologically.

When no committed event precedes a force-push, treat as unknown/GC'd.

Verified: 29 unit tests pass, 14 E2E iteration tests pass, 1477 total
tests pass with coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When URL contains ?mode=stateless, loadIterations skips ArtifactLoader
entirely and goes directly to the TimelineLoader/commit-based iteration
path. This allows users to force stateless mode even when a CodjiFlo
artifact exists.

Also adds E2E tests for:
- Real GitHub API shape (commit_id + committed events) for force-push
- ?mode=stateless query param bypassing artifact discovery

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Manual demo of the Collapsed Iterations UI feature using real GitHub
data from PR #292 in stateless mode. Covers all 9 acceptance criteria
across 8 demo steps including collapsed group tabs, history view,
expanded individual tabs, cross-boundary range selection, and
unknown/GC'd iterations handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Re-captured all demo screenshots from scratch addressing:
- #2: Visible tooltip overlay for "6 iterations discarded" hover
- #5 (new): Actual code diff shown for discarded iteration range
- #6: Cross-boundary range with code diff, not PR description
- #7 (new): Dedicated screenshot for collapsed tabs skipped in range
- #8-#10: Proper sequencing of normal selection, GC'd commits, dismiss

Expanded from 8 to 10 screenshots for complete AC coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Root cause: design doc assumed GitHub Timeline API force-push events
include before_commit/after_commit fields, but real API only provides
commit_id. All mocks (unit + E2E) were based on the wrong spec, so
the bug was invisible to the entire test suite. Caught during demo
phase when using real GitHub data.

Key lessons: verify API shapes with real data before writing specs,
add prod-mode E2E tests for API integrations, mocks are a liability
when not validated against reality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Lesson from Timeline API field mismatch bug: mocks based on assumed
API shapes can hide bugs from the entire test suite. New rule requires
verifying real API responses before writing specs/mocks, and adding
prod-mode E2E tests for API integration features.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Superseded by real-data demo at
spec/demo/milestone-4.2-stateless-iteration-management/s-4.2.2-collapsed-iterations-ui/

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pedropaulovc
pedropaulovc force-pushed the feature/collapsed-history-view branch from fa38420 to 4b11b07 Compare April 4, 2026 07:08
@vercel

vercel Bot commented Apr 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
codjiflo Ready Ready Preview Apr 4, 2026 7:15am

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.

2 participants