File size: 2,010 Bytes
1dbc34b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { darkThemes, lightThemes } from '@/config/theme-options';

/**
 * Tailwind class for top padding on macOS Electron to avoid overlapping with traffic light window controls.
 * This padding is applied conditionally when running on macOS in Electron.
 */
export const MACOS_ELECTRON_TOP_PADDING_CLASS = 'pt-[38px]';

/**
 * Shared constants for theme submenu positioning and layout.
 * Used across project-context-menu and project-selector-with-options components
 * to ensure consistent viewport-aware positioning and styling.
 */
export const THEME_SUBMENU_CONSTANTS = {
  /**
   * Estimated total height of the theme submenu content in pixels.
   * Includes all theme options, headers, padding, and "Use Global" button.
   */
  ESTIMATED_SUBMENU_HEIGHT: 620,

  /**
   * Padding from viewport edges to prevent submenu overflow.
   * Applied to both top and bottom edges when calculating available space.
   */
  COLLISION_PADDING: 32,

  /**
   * Vertical offset from context menu top to the "Project Theme" button.
   * Used for calculating submenu position relative to trigger button.
   */
  THEME_BUTTON_OFFSET: 50,

  /**
   * Height reserved for submenu header area (includes "Use Global" button and separator).
   * Subtracted from maxHeight to get scrollable content area height.
   */
  SUBMENU_HEADER_HEIGHT: 80,
} as const;

export const PROJECT_DARK_THEMES = darkThemes.map((opt) => ({
  value: opt.value,
  label: opt.label,
  icon: opt.Icon,
  color: opt.color,
}));

export const PROJECT_LIGHT_THEMES = lightThemes.map((opt) => ({
  value: opt.value,
  label: opt.label,
  icon: opt.Icon,
  color: opt.color,
}));

export const SIDEBAR_FEATURE_FLAGS = {
  hideTerminal: import.meta.env.VITE_HIDE_TERMINAL === 'true',
  hideWiki: import.meta.env.VITE_HIDE_WIKI === 'true',
  hideRunningAgents: import.meta.env.VITE_HIDE_RUNNING_AGENTS === 'true',
  hideContext: import.meta.env.VITE_HIDE_CONTEXT === 'true',
  hideSpecEditor: import.meta.env.VITE_HIDE_SPEC_EDITOR === 'true',
} as const;