Skip to content

Commit fe234ad

Browse files
committed
feat(release-notes): add release notes feature with modal and button
Add comprehensive release notes functionality including a modal for displaying version changes, an auto-checker for unviewed releases, a manual button in settings, and build-time generation from CHANGELOG.md. Includes new components, types, hooks, internationalization support, and Storybook stories for testing.
1 parent fab8e32 commit fe234ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+976
-13
lines changed

.changeset/nine-moments-rule.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"kilo-code": minor
3+
---
4+
5+
Add a button to view the latest release notes to the extension

.kilocode/rules/reactRules.md

Whitespace-only changes.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// kilocode_change - new file: Storybook story for Release Notes Modal component
2+
import type { Meta, StoryObj } from "@storybook/react-vite"
3+
import { ReleaseNotesModal } from "@/components/release-notes/ReleaseNotesModal"
4+
import { sampleReleaseNotes } from "./sampleReleaseNotes"
5+
6+
const meta = {
7+
title: "Components/ReleaseNotesModal",
8+
component: ReleaseNotesModal,
9+
argTypes: {
10+
isOpen: {
11+
control: { type: "boolean" },
12+
},
13+
loading: {
14+
control: { type: "boolean" },
15+
},
16+
currentVersion: {
17+
control: { type: "text" },
18+
},
19+
},
20+
parameters: {
21+
disableChromaticDualThemeSnapshot: true,
22+
},
23+
args: {
24+
isOpen: true,
25+
currentVersion: "4.106.0",
26+
releases: sampleReleaseNotes,
27+
loading: false,
28+
onClose: () => console.log("Modal closed"),
29+
onMarkAsViewed: (version: string) => console.log("Version marked as viewed:", version),
30+
},
31+
} satisfies Meta<typeof ReleaseNotesModal>
32+
33+
export default meta
34+
type Story = StoryObj<typeof meta>
35+
36+
export const Default: Story = {
37+
args: {
38+
releases: sampleReleaseNotes,
39+
},
40+
}
41+
42+
export const SingleRelease: Story = {
43+
args: {
44+
releases: [sampleReleaseNotes[0]],
45+
},
46+
}
47+
48+
export const Loading: Story = {
49+
args: {
50+
releases: [],
51+
loading: true,
52+
},
53+
}
54+
55+
export const EmptyReleases: Story = {
56+
args: {
57+
releases: [],
58+
loading: false,
59+
},
60+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// kilocode_change - new file: Storybook story for Show Release Notes Button Inner component
2+
import type { Meta, StoryObj } from "@storybook/react-vite"
3+
import { fn } from "storybook/test"
4+
import { ShowReleaseNotesButtonInner } from "@/components/release-notes/ShowReleaseNotesButtonInner"
5+
import { Bell } from "lucide-react"
6+
7+
const meta = {
8+
title: "Components/ShowReleaseNotesButton",
9+
component: ShowReleaseNotesButtonInner,
10+
parameters: {
11+
layout: "centered",
12+
},
13+
decorators: [
14+
(Story) => (
15+
<div className="p-4">
16+
<Story />
17+
</div>
18+
),
19+
],
20+
argTypes: {
21+
buttonText: {
22+
control: { type: "text" },
23+
},
24+
showBadge: {
25+
control: { type: "boolean" },
26+
},
27+
className: {
28+
control: { type: "text" },
29+
},
30+
},
31+
args: {
32+
onClick: fn(),
33+
},
34+
} satisfies Meta<typeof ShowReleaseNotesButtonInner>
35+
36+
export default meta
37+
type Story = StoryObj<typeof meta>
38+
39+
export const Default: Story = {
40+
args: {
41+
buttonText: "View Release Notes",
42+
showBadge: false,
43+
},
44+
}
45+
46+
export const WithBadge: Story = {
47+
args: {
48+
buttonText: "View Release Notes",
49+
showBadge: true,
50+
},
51+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// kilocode_change - new file: Sample release notes data for Storybook testing
2+
import { ReleaseNote } from "@roo-code/types"
3+
4+
export const sampleReleaseNotes: ReleaseNote[] = [
5+
{
6+
version: "4.106.0",
7+
changes: [
8+
{
9+
description: "Preliminary support for native tool calling (a.k.a native function calling) was added",
10+
prNumber: 2833,
11+
commitHash: "0b8ef46",
12+
author: "mcowger",
13+
},
14+
{
15+
description: "CMD-I now invokes the agent so you can give it more complex prompts",
16+
prNumber: 3050,
17+
commitHash: "357d438",
18+
author: "markijbema",
19+
},
20+
],
21+
},
22+
{
23+
version: "4.105.0",
24+
changes: [
25+
{
26+
description: "Improve the edit chat area to allow context and file drag and drop when editing messages",
27+
prNumber: 3005,
28+
commitHash: "b87ae9c",
29+
author: "kevinvandijk",
30+
},
31+
{
32+
description: "A warning is now shown when the webview memory usage crosses 90% of the limit",
33+
prNumber: 3046,
34+
commitHash: "1bd934f",
35+
author: "chrarnoldus",
36+
},
37+
],
38+
},
39+
]

packages/types/src/global-settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ export const globalSettingsSchema = z.object({
175175
customSupportPrompts: customSupportPromptsSchema.optional(),
176176
enhancementApiConfigId: z.string().optional(),
177177
dismissedNotificationIds: z.string().array().optional(), // kilocode_change
178+
lastViewedReleaseVersion: z.string().optional(), // kilocode_change
178179
commitMessageApiConfigId: z.string().optional(), // kilocode_change
179180
terminalCommandApiConfigId: z.string().optional(), // kilocode_change
180181
ghostServiceSettings: ghostServiceSettingsSchema, // kilocode_change

packages/types/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export * from "./type-fu.js"
2525
export * from "./vscode.js"
2626
export * from "./kilocode/kilocode.js"
2727
export * from "./kilocode/native-function-calling.js"
28+
export * from "./release-notes.js" // kilocode_change
2829
export * from "./usage-tracker.js" // kilocode_change
2930

3031
export * from "./providers/index.js"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// kilocode_change - new file
2+
export interface ReleaseItem {
3+
description: string
4+
prNumber?: number
5+
commitHash?: string
6+
author?: string
7+
}
8+
9+
export interface ReleaseNote {
10+
version: string
11+
changes: ReleaseItem[]
12+
}
13+
14+
export interface ReleaseData {
15+
currentVersion: string
16+
releases: ReleaseNote[]
17+
}

pnpm-lock.yaml

Lines changed: 21 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/shared/ExtensionMessage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ export type ExtensionState = Pick<
360360
| "commitMessageApiConfigId" // kilocode_change
361361
| "terminalCommandApiConfigId" // kilocode_change
362362
| "dismissedNotificationIds" // kilocode_change
363+
| "lastViewedReleaseVersion" // kilocode_change
363364
| "ghostServiceSettings" // kilocode_change
364365
| "autoPurgeEnabled" // kilocode_change
365366
| "autoPurgeDefaultRetentionDays" // kilocode_change

0 commit comments

Comments
 (0)