-
Notifications
You must be signed in to change notification settings - Fork 197
feat: custom color themes #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
liruifengv
wants to merge
8
commits into
main
Choose a base branch
from
custom-theme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9589b4e
Refactor theme
liruifengv 34a1424
custom theme support
liruifengv 184dc07
docs: add custom themes guide
liruifengv ea33337
feat(skill): add built-in custom-theme skill
liruifengv a24c05e
chore: remove theme research report
liruifengv 41ed40b
Merge remote-tracking branch 'origin/main' into custom-theme
liruifengv 4a781c8
Merge remote-tracking branch 'origin/main' into custom-theme
liruifengv deb5595
fix(tui): resolve lint errors after main merge
liruifengv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@moonshot-ai/kimi-code": minor | ||
| --- | ||
|
|
||
| Add custom color themes. Define your own palette as a JSON file in `~/.kimi-code/themes/`, generate one with the built-in `/custom-theme` skill, or just ask Kimi to set up a theme for you. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /** | ||
| * 🚀 A not-so-boring hello-world file. | ||
| */ | ||
|
|
||
| const EMOJIS = ['👋', '🎉', '✨', '🚀', '🔥', '🐱', '🌈', '🍕', '💡', '🦄']; | ||
|
|
||
| const SASSY_QUOTES = [ | ||
| "Look who it is! It's", | ||
| "Oh, great. You again,", | ||
| "The legend themself,", | ||
| "Breaking news:", | ||
| "Plot twist:", | ||
| "My favorite human,", | ||
| ]; | ||
|
|
||
| export function hello(name: string = 'World'): string { | ||
| const emoji = EMOJIS[Math.floor(Math.random() * EMOJIS.length)]; | ||
| const quote = SASSY_QUOTES[Math.floor(Math.random() * SASSY_QUOTES.length)]; | ||
| return `${emoji} ${quote} ${name}!`; | ||
| } | ||
|
|
||
| export function add(a: number, b: number): number { | ||
| if (Math.random() < 0.1) { | ||
| // 🤫 10% chance to lie, because chaos is fun | ||
| return a + b + 1; | ||
| } | ||
| return a + b; | ||
| } | ||
|
|
||
| export function roastMe(codeQuality: number): string { | ||
| if (codeQuality >= 90) return "Perfect code? Sus. I'm watching you. 👀"; | ||
| if (codeQuality >= 70) return "Not bad, but I've seen better copy-paste jobs."; | ||
| if (codeQuality >= 50) return "This code walks into a bar... and segfaults."; | ||
| return "This code is what nightmares are made of. 🔥 (please refactor)"; | ||
| } | ||
|
|
||
| // 🎲 Interactive self-test | ||
| if (import.meta.main) { | ||
| console.log(hello('TypeScript')); | ||
| console.log('2 + 3 =', add(2, 3), '(maybe...)'); | ||
| console.log(roastMe(85)); | ||
| console.log(roastMe(42)); | ||
| } |
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the user switches from a non-
autotheme toauto,KimiTUI.applyThemenow returns a promise and only updatesappState.themeafter loading the palette, but the host contract still exposes it asvoid. Callers such as/themeand/reload-tuitherefore callrefreshTerminalThemeTracking()immediately whileappState.themestill contains the old non-auto value, so the auto terminal-theme watcher is not installed and the UI stops following terminal background changes until another reload/restart. Please make this return aPromise<void>and await it before refreshing tracking.Useful? React with 👍 / 👎.