Repository navigation
feat(studio): L01 versions tab timeline - #1002
Merged
Merged
Conversation
Adds /agents/:id/versions: newest-first timeline of every saved version
(number, kind/source, Current pill, relative time, summary or pending
skeleton, quoted request text, changed-field chips capped at 4 + +N,
baseline hint) plus a Save version button. Live via /events:
version.summary fills skeletons in place, agent.changed version reasons
re-fetch. New versionLabels.ts (FIELD_LABELS/KIND_LABELS/SOURCE_LABELS,
kindLabel, summaryPending) and useVersions.ts hook; registered in
tabScreens.ts and BUILT_AGENT_TABS. relativeTime added to formatTime.ts.
D07 already shipped listVersions/saveVersion/getVersion on
runtimeClient (saveVersion returns {item, created}); wireTypes already
declare the Contract B version types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements ticket L01 (Forge Builder P7): the
/agents/:id/versionstab.src/screens/agentDetail/VersionsTab.tsx+versions.css: newest-first timeline — version number, kind/source labels, "Current" pill on the newest item, relative time, summary (skeleton + visually-hidden "Writing a summary" while pending, baseline hint for external edits), curly-quoted request text, changed-field chips (max 4 ++N), empty.version-actionsslot for L02/L03/L14b.src/screens/agentDetail/versionLabels.ts:FIELD_LABELS(every spec field + labels),KIND_LABELS,SOURCE_LABELS,fieldLabel,kindLabel(Restored from v<n>),summaryPending(2-minute window).src/screens/agentDetail/useVersions.ts: fetch on mount/agentId change with stale-response guard;version.summaryevents patch summaries in place;agent.changedwith version/restore/import/save reasons re-fetch.Save versionbutton: disabled +aria-busywhile pending; success toastSaved v<n>, info toastNothing changed since v<n>on the server no-op, error toast on failure; then refresh.versionsintabScreens.tsandBUILT_AGENT_TABS(agents/agentTabs.ts); addedrelativeTimetocomponents/formatTime.ts.Deviations from the ticket contract (D07 already landed on main):
runtimeClient.listVersions/saveVersionalready exist;saveVersionreturns{ item, created }rather than a bareVersionListItem— thecreatedflag drives the "Nothing changed" toast.VersionKind/VersionSource/VersionListItemalready declared inshared/wireTypes.ts(incl.'copy'source → "as a copy" label).VersionsTabtakes no props and reads the agent id fromAgentDetailContext, matchingRunsTab/TAB_SCREENS(() => ReactNode).Test plan
npx vitest run --root apps/agent-forge src/screens/agentDetail src/screens/agents— 17 files / 115 tests pass, incl. newversionLabels.test.ts(11) andVersionsTab.test.tsx(12: ordering, Current pill, pending skeleton +version.summaryswap, chip overflow, baseline hint, empty/error/loading, save toasts).npm run typecheck --workspace apps/agent-forge— clean.npx eslinton touched files — clean;npx fallow dead-code apps/agent-forge— no issues (onefallow-ignoreonKIND_LABELS, a contract export for L02/L03/L14b).