Skip to content

Add context menus to Resource and Scenario chart controls#1

Merged
neuron-tech-ai merged 13 commits into
developfrom
feature/context-menus-resource-scenario-charts
May 11, 2026
Merged

Add context menus to Resource and Scenario chart controls#1
neuron-tech-ai merged 13 commits into
developfrom
feature/context-menus-resource-scenario-charts

Conversation

@neuron-tech-ai

Copy link
Copy Markdown
Owner

Summary

  • Synced fork with upstream (countincognito/Zametek.ProjectPlan) before making changes — fork is now at 8516ae9
  • Added rich right-click context menus to the Resource chart following the exact same convention as the Gantt chart
  • Added rich right-click context menus to the Scenario chart following the exact same convention as the Gantt chart
  • Scenario chart sidebar options are now scrollable (required because TrackedMetrics has 34 values)

Convention match

All context menus follow the Gantt chart pattern exactly:

  • EnumToBoolConverter (from Avalonia.Controls.Converters) added as a StaticResource on each view
  • Boolean options exposed as ToggleType="CheckBox" MenuItem items bound TwoWay
  • Enum options exposed as submenu ToggleType="Radio" items with one-way IsChecked binding via EnumToBoolConverter and a typed ICommand taking the enum value as CommandParameter
  • Separator between option groups and before SaveAs / Reset

Resource chart changes

Context menu:

  • ShowToday and ShowMilestones checkbox toggles
  • AllocationMode submenu: Activity / Cost / Billing / Effort (Radio) via ChangeAllocationModeCommand
  • ScheduleMode submenu: Combined / Scheduled / Unscheduled (Radio) via ChangeScheduleModeCommand
  • DisplayStyle submenu: Slanted / Block (Radio) via ChangeDisplayStyleCommand
  • Save As and Reset

Sidebar: VerticalScrollBarVisibility changed to Auto

ViewModel / Interface: Added ShowMilestones to interface (was missing), added three typed ICommand properties and corresponding private async handlers

Scenario chart changes

Context menu:

  • ShowNames checkbox toggle
  • TrackedMetricXAxis submenu: all 34 TrackedMetrics values (Radio) via ChangeTrackedMetricXAxisCommand
  • TrackedMetricYAxis submenu: all 34 TrackedMetrics values (Radio) via ChangeTrackedMetricYAxisCommand
  • CurveFittingType submenu: None / Linear / Exponential / Logarithmic / Power / PolynomialOrder2-4 (Radio) via ChangeCurveFittingTypeCommand
  • Save As and Reset

Sidebar: VerticalScrollBarVisibility changed to Auto -- options are scrollable as required

ViewModel / Interface: Added three typed ICommand properties and corresponding private async handlers

Test plan

  • Right-click on Resource chart canvas shows full context menu with checkbox toggles and dropdown submenus
  • Selecting AllocationMode / ScheduleMode / DisplayStyle from context menu updates the chart
  • ShowToday / ShowMilestones toggles in context menu are in sync with the sidebar switches
  • Right-click on Scenario chart canvas shows full context menu
  • Selecting TrackedMetricXAxis / TrackedMetricYAxis / CurveFittingType from context menu updates the chart
  • ShowNames toggle in context menu is in sync with the sidebar switch
  • Scenario chart sidebar scrolls when the window is small enough to require it
  • Build passes with 0 warnings and 0 errors

Resource chart:
- Right-click context menu now includes ShowToday and ShowMilestones
  checkbox toggles, matching the Gantt chart convention
- Dropdown submenus for AllocationMode, ScheduleMode, and DisplayStyle
  with Radio button selection via ChangeAllocationModeCommand,
  ChangeScheduleModeCommand, and ChangeDisplayStyleCommand
- Sidebar ScrollViewer changed from VerticalScrollBarVisibility=Hidden
  to Auto so options are scrollable when the panel is constrained

Scenario chart:
- Right-click context menu now includes ShowNames checkbox toggle
- Dropdown submenus for TrackedMetricXAxis, TrackedMetricYAxis, and
  CurveFittingType with Radio button selection via dedicated commands
- Sidebar ScrollViewer changed to Auto — required because TrackedMetrics
  has 34 values and the options panel must be scrollable
- All 34 TrackedMetrics values enumerated in both X/Y axis submenus

Both charts follow the exact same convention as the Gantt chart:
EnumToBoolConverter for Radio checked state, ToggleType=Radio on enum
submenus, ToggleType=CheckBox on boolean options, Separator before
SaveAs/Reset, ICommand per enum type with async error handling.
- Consistent typography: SemiBold for section labels, LineHeight 18 on TextBlock
- Spacing rhythm: 8px margin on panels (multiples of 4), 12px between form groups
- Toolbar/status bar: subtle top border separating status bar from content
- Side panels: left border divider for chart control panels (ResourceChart, ScenarioChart, ResourceSettings)
- Compact form labels: 11px SemiBold at 0.65 opacity as field captions; 12px values at full opacity
- ToggleSwitch alignment: left-aligned in side panels for visual consistency
- DataGrid column headers: SemiBold weight, 28px min height for clarity
- Button padding: 8x4 for better click target and visual rhythm
- ComboBox: explicit MinHeight 25 and Padding 6,3 for uniform sizing
- Editable cell palette: refined warm cream/amber scheme (Light); clearly distinct states
- GridSplitter in TrackingView: matches theme border color instead of harsh black
- MetricView values: SemiBold (down from Bold) for softer emphasis
- About dialog header: SemiBold for cleaner weight
- Error border: slightly softer red (#DC2626) in MainView
ScottPlot's AvaPlot has a built-in right-click menu. After clearing it
Menu?.Clear() was followed by Menu?.Add() which re-populated it, causing
both the ScottPlot menu and the Avalonia ContextMenu to open simultaneously.

Fix: remove the Add() calls. Save As and Reset are already present in the
Avalonia ContextMenu on the ContentControl, so no functionality is lost.
- Comprehensive design token system (ZBackground, ZSurface, ZAccent, etc.)
  with full Light and Dark theme support in App.axaml ThemeDictionaries
- Base font size 12→13px across TextBlock, Label, Button, ComboBox, MenuItem
- MainView: remove window margin and outer border; redesigned menu bar (36px,
  white bg, bottom border); error state replaced by subtle 3px top accent bar;
  cleaner 30px status bar with ZStatusBar background and muted 11px labels
- ZametekTheme.axaml: dedicated Styles file with overrides for DataGrid,
  DataGridColumnHeader, Dock tabs (TabItem), MenuItem, Button, ComboBox,
  TextBox, DatePicker, ToggleSwitch, and section-header label class
- ResourceChartManagerView and ScenarioChartManagerView side panels: replaced
  nested DockPanel stacks with StackPanel, removed hardcoded BorderBrush/Height
  values, switched to ZBorder/ZSurface tokens, section-header label class
- GanttChartManagerView: removed outer Margin="7"
- ActivitiesManagerView: removed outer margin, changed grid lines to Horizontal
- Dark mode palette aligned to same design system (navy accent, dark surfaces)
…ound overrides

- Remove Z* brush static fallbacks from outside ThemeDictionaries in App.axaml;
  only ThemeDictionary Light/Dark entries now define theme-sensitive colors so
  Avalonia's resource lookup correctly switches values on theme change
- Remove global Foreground setters on TextBlock/SelectableTextBlock/Label in
  ZametekTheme.axaml to stop fighting Semi.Avalonia's per-component dark-mode
  text theming
- Remove Background/Foreground from DataGrid and DataGridColumnHeader styles;
  let Semi handle theme-aware grid coloring
- Fix hardcoded BorderBrush="Gray" in AddNodeTagView and NodeNameView; replace
  with DynamicResource ZBorder so borders render correctly in dark mode
…mand palette

- Replace Dock.Avalonia free-floating layout with fixed opinionated shell
- Left sidebar: 52px icon-based navigation between all views (Activities+Gantt,
  Resources, Scenario, Arrow Graph, Vertex Graph, Tracking)
- Home view: Activities + Gantt side-by-side with live GridSplitter (40/60 split)
- Auto-compile already enabled by default for live feedback loop
- Toolbar: full menu bar + quick-action buttons (Add Activity, Compile, Dates,
  Cost) + Ctrl+K command palette trigger badge
- Stats bar: project title + compilation status (OK / Stale / Errors) always visible
- Command palette: Ctrl+K overlay with searchable list of 22 commands, Escape to
  close, auto-closes after execution
- ShellView enum in Common.ProjectPlan; ActiveShellView + IsCommandPaletteOpen on
  IMainViewModel + MainViewModel; panel VM properties exposed on MainViewModel
  for clean AXAML binding without ViewLocator indirection in HomeView
- IsShellViewMatch converter added to EnumConverters for sidebar active-state binding

Pre-existing test failure (Converter_Given_v0_2_1_Input_Then_ConvertsTo_v0_3_0) is
unrelated to this change and fails on the unmodified branch.
…treams, graph settings, holidays, metrics, earned value, project scenario, output
…fix arrowhead indicator size; wire SelectActivity navigation for graph click-to-navigate
…moji shortcuts

- Add Activity / Insert / Milestone buttons now visible in activities panel toolbar
- Remove + Activity and emoji shortcut buttons from main titlebar (was cluttering menu area)
- Replace MsBox confirmation dialog with custom native Avalonia window (no more blue MsBox buttons)
- Keep Compile shortcut button in toolbar only
@neuron-tech-ai neuron-tech-ai merged commit 5dd455b into develop May 11, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant