Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ImLukzy/ChefDash/llms.txt

Use this file to discover all available pages before exploring further.

The Profile screen is where ChefDash surfaces the two pieces of identity that define every player session: a name and an emoji avatar. Both values live as @Published properties on GameState, meaning any future change to either one is immediately reflected in the HomeView HUD chip without any manual refresh. The screen becomes active when gameState.activeTab is set to "profile".

Reaching the Profile Screen

Tapping the player chip in the top-left corner of HomeView is the only navigation path to the Profile screen. The chip displays the player’s avatar emoji, their uppercased name, and their current coin balance. The tap handler sets gameState.activeTab = "profile" with a spring animation:
withAnimation(.spring(response: 0.4, dampingFraction: 0.75)) {
    gameState.activeTab = "profile"
}
There is no dedicated entry in the CustomTabBar for the Profile screen — it sits outside the three main tab bar items and is accessed exclusively through the HomeView chip shortcut.

Displayed Data

The Profile screen presents the two GameState properties that identify the player:
PropertyTypeDefault ValueWhere It Appears
playerNameString"Chef Novato"HomeView HUD chip (uppercased), Profile screen
playerAvatarString"👨‍🍳"HomeView HUD chip, Profile screen
Both properties are declared on GameState as shown below:
@Published var playerName: String = "Chef Novato"
@Published var playerAvatar: String = "👨‍🍳"

In-Memory State

playerName and playerAvatar are held in memory on the GameState instance for the duration of the app session. They are not persisted to disk in the current implementation — closing and relaunching the app restores both properties to their default values ("Chef Novato" and "👨‍🍳").

Relationship to the HomeView HUD

Because playerName and playerAvatar are @Published, SwiftUI’s @EnvironmentObject mechanism causes the HomeView player chip to re-render automatically whenever either value changes. The chip reads both properties directly:
Text(gameState.playerAvatar)
    .font(.system(size: 24))
VStack(alignment: .leading, spacing: 2) {
    Text(gameState.playerName.uppercased())
        .font(.system(size: 11, weight: .black, design: .monospaced))
        .foregroundColor(.white)
    Text("🪙 \(gameState.coins)")
        .font(.system(size: 10, weight: .bold, design: .monospaced))
        .foregroundColor(neonYellow)
}
No manual binding or refresh is required — the HUD always reflects the current GameState values.

Build docs developers (and LLMs) love