Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/web-dev-mode-indicator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Add a development-mode indicator to the web sidebar for local development.
25 changes: 23 additions & 2 deletions apps/kimi-web/src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
<script setup lang="ts">
import { computed, nextTick, onBeforeUnmount, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { serverEndpointLabel } from '../api/config';
import type { Session, WorkspaceGroup as WorkspaceGroupType, WorkspaceView } from '../types';
import SessionRow from './SessionRow.vue';
import WorkspaceGroup from './WorkspaceGroup.vue';

const { t } = useI18n();

// Dev-only affordance: when the page is served by the Vite dev server, the
// logo turns yellow and the backend host:port is appended to the title —
// handy for telling several dev tabs apart. In production this is all inert.
const isDev = import.meta.env.DEV;
const endpoint = isDev ? serverEndpointLabel() : '';

const props = withDefaults(
defineProps<{
activeWorkspace: WorkspaceView | null;
Expand Down Expand Up @@ -395,7 +402,7 @@ function blinkOnce(): void {
<!-- Header: logo + settings (no hard border — flows into workspace list) -->
<div class="ch">
<div class="ch-brand">
<svg ref="logoRef" class="ch-logo" viewBox="0 0 32 22" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Kimi Code" @click="blinkOnce">
<svg ref="logoRef" class="ch-logo" :class="{ 'is-dev': isDev }" viewBox="0 0 32 22" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Kimi Code" @click="blinkOnce">
<defs>
<mask id="kimiEyes" maskUnits="userSpaceOnUse">
<rect x="0" y="0" width="32" height="22" fill="#fff" />
Expand All @@ -407,7 +414,7 @@ function blinkOnce(): void {
</defs>
<rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#kimiEyes)" />
</svg>
<span class="ch-name">Kimi Code</span>
<span class="ch-name">Kimi Code<span v-if="isDev" class="ch-endpoint"> · {{ endpoint }}</span></span>
</div>
<button
type="button"
Expand Down Expand Up @@ -645,6 +652,12 @@ function blinkOnce(): void {
.ch-logo:hover {
transform: scale(1.08);
}
/* Dev-only: tint the mark yellow so a `pnpm dev:web` tab is obvious at a
glance. `--logo` is read by the mark's `fill`; overriding it on the svg
recolors just this instance. */
.ch-logo.is-dev {
--logo: #f5b301;
}
.ch-brand {
display: flex;
align-items: center;
Expand All @@ -662,6 +675,14 @@ function blinkOnce(): void {
text-overflow: ellipsis;
white-space: nowrap;
}
/* Dev-only: backend host:port appended to the title. Kept secondary so the
product name still leads. */
.ch-endpoint {
color: var(--muted);
font-family: var(--mono);
font-weight: 400;
font-size: calc(var(--ui-font-size) - 1px);
}

/* In narrow sidebars the product name drops out so the logo keeps its fixed
size and the action buttons remain reachable. */
Expand Down
Loading