<commit_before>MENU_WIDTH = 120

# the main menu displayed on the left hand side
# opens the specified content in the main window
# find the corresponding classes in the tabs directory
def menu
  stack width: MENU_WIDTH do
    # TODO Why doesn't para link work? o_O
    button "Home" do
      PomodoroTracker::SideTab.open PomodoroTracker::Home
    end
    button "Inventory" do
      PomodoroTracker::SideTab.open PomodoroTracker::ActivityInventoryTab, @inventory
    end
    button 'ToDo Today' do
      PomodoroTracker::SideTab.open PomodoroTracker::TodayTab, @inventory
    end
    button "Close" do close if confirm "Are you sure?" end
  end
end

def boot
  @inventory = PomodoroTracker::ActivityInventory.new
end

# main app
Shoes.app title: "pomodoro tracker", width: 500, height: 600 do
  boot
  title "Pomodoros track you must", :align => "center"
  flow do
    menu
    @main_content = stack width: -MENU_WIDTH
  end

  PomodoroTracker::SideTab.setup(@main_content)
  # we start at home!
  PomodoroTracker::SideTab.open(PomodoroTracker::Home)
end
<commit_msg>General shortcuts to access the inventory, the todo today or quit the application<commit_after>MENU_WIDTH = 120

# the main menu displayed on the left hand side
# opens the specified content in the main window
# find the corresponding classes in the tabs directory
def menu
  stack width: MENU_WIDTH do
    # TODO Why doesn't para link work? o_O
    button "Home" do
      PomodoroTracker::SideTab.open PomodoroTracker::Home
    end
    button "Inventory" do open_inventory end
    button 'ToDo Today' do open_today end
    button "Close" do close_pomodoro  end
  end
end

def open_inventory
  PomodoroTracker::SideTab.open PomodoroTracker::ActivityInventoryTab, @inventory
end

def open_today
  PomodoroTracker::SideTab.open PomodoroTracker::TodayTab, @inventory
end

def close_pomodoro
  close if confirm "Are you sure?"
end

def boot
  @inventory = PomodoroTracker::ActivityInventory.new
end

def general_key_handlers
  keypress do |key|
    open_inventory if key == :control_i
    open_today if key == :control_t
    close_pomodoro if key == :control_q
  end
end

# main app
Shoes.app title: "pomodoro tracker", width: 500, height: 600 do
  boot
  title "Pomodoros track you must", :align => "center"
  flow do
    menu
    @main_content = stack width: -MENU_WIDTH
  end
  
  general_key_handlers

  PomodoroTracker::SideTab.setup(@main_content)
  # we start at home!
  PomodoroTracker::SideTab.open(PomodoroTracker::Home)
end

{'fraction_non_alphanumeric': 0.0704, 'fraction_numerical': 0.0072, 'mean_word_length': 4.167355371900826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5610805', 'n_tokens_mistral': 831, 'n_tokens_neox': 785, 'n_words': 268}