Cartographer App User and Technical Documentation
Home
User Docs
Technical Docs
Home
User Docs
Technical Docs
  • User Documentation
    • Introduction
    • Getting Started
    • User Interface
    • Actions
  • Technical Documentation
    • GitHub Authentication
    • Components

      • AppFooter Component
      • AppHeader Component
      • AppSidebar Component
      • ContentPreviewMdiv Component
      • Content Preview Measure
      • Content Preview Pane
      • ImageMismatchModal Component
      • ImageSelection Modal
      • LoadGitModal Component
      • LoadIIIFModal Component
      • LoadLocalImage Component
      • LoadXMLModal Component
      • MainMenu Component
      • MeasureModal Component
      • MdivModal Component
      • OsdComponent Component
      • PageImportModal Component
      • PagesListEntry Component
      • PagesModal Component
      • Vuex Store (src/store/index.js)
    • Store
      • Vuex Store (src/store/index.js)
    • Tools
      • IIIF Tools (src/tools/iiif.js)
      • MEI Mapping Tools (src/tools/meiMappings.js)

MainMenu Component

MainMenu provides file import and export actions, GitHub integration, page controls, and the native GitHub Device Flow prompt.

Layout

The dropdown is opened with the bars button and contains these sections:

  • User: Upload MEI, import IIIF or local images, log in with GitHub, load from GitHub, and download MEI
  • GitHub branch: Commit the loaded GitHub file when GitHub file metadata is available
  • Actions: Show the page overview and toggle the measure list
  • Options: Toggle merge mode when unzoned measures are available

The Device Flow sign-in card is outside the dropdown so it remains visible when the menu closes. It is rendered only while auth.state.devicePrompt contains a verification URL and user code.

Props

None

Computed properties

NameDescription
manifestCurrent IIIF manifest from the root store
xmlFilenameFilename used when downloading MEI
downloadAvailableWhether generated MEI is available
firstMeasureWithoutZoneFirst measure eligible for merge mode
existingMusicModeWhether merge mode is active
isAuthenticatedAuthentication status from auth/isAuthenticated
githubFileMetadata for the MEI file loaded from GitHub
selectedBranchBranch selected in the authentication module
githubBranchLabelBranch label displayed above the commit action
devicePromptNative Device Flow URL and temporary user code

Methods

NameDescription
importXMLOpens the MEI upload modal
importManifestOpens the IIIF import modal
importLocalImageOpens the local-image import modal
loadFromGithubOpens the GitHub repository browser
loginToGithubSelects browser OAuth or native Device Flow
copyDeviceCodeCopies the temporary Device Flow code
commitToGithubOpens the GitHub commit modal
xmlDataUrlCreates the data URL used to download MEI
toggleMeasureListShows or hides the measure list
showPagesModalOpens the page overview
toggleExistingMusicModeToggles merge mode when available

Authentication behavior

loginToGithub checks window.__TAURI_INTERNALS__:

  • In a browser, it dispatches auth/login, which starts OAuth redirect login.
  • In a Tauri desktop or Android application, it dispatches auth/loginDevice, which requests a device code through the Rust backend.

During Device Flow, the component displays the verification URL, temporary code, copy button, and waiting status. Login errors are shown through an alert. The store handles GitHub's polling interval and updates authentication state when authorization succeeds.

See GitHub Authentication for the complete browser and native flows.

Example

<MainMenu />
Prev
LoadXMLModal Component
Next
MeasureModal Component