Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
> visual direction, and Linux integrations are expected to change.

[![Status: work in progress](https://img.shields.io/badge/status-work_in_progress-f59e0b)](#project-status)
[![Phase: 5 local gate passed](https://img.shields.io/badge/phase-5_local_gate_passed-22c55e)](#current-status)
[![Phase: 6 frontend foundation](https://img.shields.io/badge/phase-6_frontend_foundation-22c55e)](#current-status)
[![License: BSD-3-Clause](https://img.shields.io/badge/license-BSD--3--Clause-22c55e)](LICENSE)
[![CI](https://github.com/MoazMustafa-stack/Velora/actions/workflows/ci.yml/badge.svg)](https://github.com/MoazMustafa-stack/Velora/actions/workflows/ci.yml)
[![Buy me a coffee](https://img.shields.io/badge/Support-Ko--fi-ff5e5b)](https://ko-fi.com/moazmustafa)
Expand All @@ -30,9 +30,14 @@ normal desktop remains available if Velora exits.

## Current status

Phases 1–4 are complete and merged to `main`. Phase 5 (D-Bus media and
notifications) is implemented on `dbus-media-core`; its cumulative local
release gate passes, and the work is awaiting commit/review/merge.
Phases 1–5 are complete and merged to `main` (Phase 5: PR #8).
Phase 6 is the frontend experience pass, not another system integration.
Its D6.01–D6.04 foundation introduces semantic design tokens, shared panel
and list primitives, a bounded UI-only preferences API, and one modal/input
coordinator. See the [visual inventory](frontend/godot/ASSET_INVENTORY.md)
and [settings contract](config/README.md). Settings screens, onboarding,
art redesign, accessibility controls, audio, remapping UI, and station
customization remain later Phase 6 work.

Phase 1.01–1.10 provides a Godot 4.7 pixel-perfect foundation, a 16 px tile
hub, eight-direction movement with four-direction facing, sprinting, physical
Expand Down
22 changes: 22 additions & 0 deletions config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Configuration boundaries

The old `default.toml` was never loaded and advertised protocol v1. It has
been removed; the current wire version is owned by `velora-protocol`, not
user configuration. Core runtime options remain the environment variables
documented in the root README.

Frontend UI preferences use `scripts/settings_store.gd` in the Godot project.
The store owns `user://velora-settings.json` with schema version 1 and a
16 KiB maximum. Loading or constructing the store never creates a file.
Only explicit save/reset operations write, and reset removes only that file.

Allowlisted preferences: onboarding completion, reduced motion, UI-audio mute
and volume (0–1), up to four keyboard keys per named action, and fixed
editor/browser/terminal slots containing syntactically validated desktop IDs.
Missing values use defaults; invalid files use all defaults; unknown fields
are ignored and never written back. No live system data is stored.

This is a foundation API, not a new settings UI or remapping feature.
Later Phase 6 cards consume these preferences. A stored desktop ID must still
resolve against the live trusted registry before a launch can be requested.
It is never a command, path, argument list, or permission to bypass Core.
18 changes: 0 additions & 18 deletions config/default.toml

This file was deleted.

46 changes: 46 additions & 0 deletions frontend/godot/ASSET_INVENTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Fixed-canvas visual inventory

Baseline: merged Phase 5 `5bdf1dc`, 320 × 180, nearest integer scaling,
Godot Compatibility renderer. No downloaded art or fonts are introduced.

| Surface | Source and visual contract |
| --- | --- |
| Floor, walls, path, threshold | `scripts/pixel_art.gd`: generated 64 × 16 atlas of four 16 × 16 tiles; hub builds boundary/collisions |
| Player | Generated 16 × 24 sprites, four directions × two steps; player caches textures |
| Application stations | Generated workstation texture; three registry-backed objects and state markers |
| HUD and pause | `scenes/main.tscn`, `ui/hud.gd`; fixed status/connection/prompt regions, scene-local styles |
| Notification feed | Four fixed two-line rows; `!! CRIT`, `! NORM`, `. LOW`; 32 tracked entries |
| Media console | Three fixed two-line rows; `+ PLAY`, `= PAUSE`, `. STOP`; 16 tracked players, capability-specific controls |
| Workspace map | Five-column, maximum 20-cell grid; active `>`, urgent `!`, special `~` markers |
| Typography | Godot default font; body 7 px, title/counter 8 px; clipped fixed-region labels |
| Spacing | 4 px base, 16 px tile; list panels at (40,24), width 240; map at (40,30) |

`ui/design_tokens.gd` owns shared semantic colors, geometry and font sizes.
Ready cyan, waiting amber and failure red supplement labels and symbols.
World amber/text retain their slightly different original values, intentionally.
Sprite-local skin, clothing and texture-detail shades are not UI palette roles.
Scene-authored HUD styles remain serialized scene resources, not panel constants.

Rendered baseline on Intel UHD (CML GT2), Wayland: 60.00 FPS average,
18.43 ms p95, 600 frames. Resource baseline: 0.0% sampled idle Core CPU,
20 KiB RSS growth; private-D-Bus overhead 1752 KiB, 0 KiB growth.
Synthetic baseline images are private local evidence, not live session captures.

The token-only migration was byte-identical across hub, notification feed,
empty media and workspace fixtures. The later workspace primitive migration
deliberately gives cells a readable fixed width and tighter vertical margins;
all 20 cells and the footer now fit inside the canvas. Selection follows the
workspace handle rather than jumping back to the active workspace on updates.

For reproducible synthetic visual review (requires a graphical session):

```bash
capture_dir="$(mktemp -d /tmp/velora-visual.XXXXXX)"
VELORA_VISUAL_DIR="$capture_dir" godot --path frontend/godot \
--script res://tests/visual_foundation_fixture.gd
```

The fixture disables backend auto-connect and exports native and scaled
frames for populated, empty, waiting, unavailable, stale, and crowded views.
It reads no live notifications, media or compositor data. Review these frames
alongside `./scripts/velora.sh gate` and `./scripts/velora.sh perf`.
55 changes: 55 additions & 0 deletions frontend/godot/FOUNDATION_REVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# D6.01–D6.04 foundation acceptance

Reviewed on 2026-09-26 against merged Phase 5 baseline `5bdf1dc`.
This records local evidence, not a claim that GitHub CI ran.

| Card | Evidence |
| --- | --- |
| D6.01 | Token tests; byte-identical before/after token-migration frames for hub, feed, empty media and workspace map; inventory in `ASSET_INVENTORY.md` |
| D6.02 | Existing notification/media suites retained; cursor tests for bounds, wrap, deletion and stable keys; workspace handle preservation; counters and 20-cell geometry regression tests |
| D6.03 | Temporary-file round trips, defaults, corrupt/oversized/unknown/partial files, malformed bindings/IDs, field allowlist, mutable-copy isolation, reset isolation; unused v1 config removed |
| D6.04 | 30 cycles through all modal states; late close rejection; live status while paused; real prompt restoration; actual viewport key events; context-specific media keys and InputMap substitution |

## Validation

- `./scripts/velora.sh gate`: passed, including 224 Rust tests, strict Clippy,
all prior frontend tests, the five new foundation suites, security checks,
and Core/private-D-Bus resource gates.
- `./scripts/check-ipc.sh`: passed isolated handshake/restart/reconnect.
- `./scripts/check-dev.sh`: passed normal-exit and signal child cleanup.
- `./scripts/velora.sh perf`: passed on Intel UHD (CML GT2), Wayland,
Compatibility renderer, 600 frames. Before: 60.00 FPS, 18.43 ms p95.
After: 60.00 FPS, 17.09 ms p95. These samples show no budget regression;
they are not a claim of a statistically significant speedup.
- Core idle CPU: 0.0%, RSS growth 20 KiB. Private-D-Bus overhead: 1756 KiB,
growth 0 KiB during the sample window.
- Input-action and overlay suites also passed with the real Wayland renderer.
- Agent inspected native 320 × 180 and integer-scaled synthetic frames:
populated/empty feed, restricted state, populated/stale media, crowded
workspaces and pause. No live data was captured.
- `git diff --check`: passed. No Core/protocol changes in this branch,
no system configuration writes, no private docs or generated media staged.

## Review findings resolved

- Clipped counters were squeezed to zero width next to an expanding title:
reserve a bounded counter region and test its width.
- Clipped workspace cells collapsed to unreadable strips: assign a fixed
column width and preserve the selection by handle across updates.
- A full 20-cell map exceeded the canvas by six pixels: tighten cell vertical
margins; verify the complete panel/footer fits within 180 px.
- A settings file could grow between its size check and read: bound both.

## Boundaries and follow-up

This is an implementation self-review, not an independent human approval.
Rendered keyboard tests use synthetic input; the owner's real-system Phase 5
acceptance is recorded on PR #8. No new live application launch is claimed.

Existing pause copy still says Phase 1 and its telemetry/HUD layering needs
the planned D6.06/D6.08 pass. The settings API deliberately does not introduce
a settings UI, apply remapping, or make saved station IDs launchable.
Those remain later cards, along with color/grayscale accessibility refinement.

Next: D6.05 — unified world-object art and hub layout. Phase 6 as a whole is
not complete; D6.05–D6.13 remain.
38 changes: 38 additions & 0 deletions frontend/godot/scripts/input_actions.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
extends RefCounted
## Shared defaults. Existing bindings are never overwritten by registration.
## Context decides which actions are active (N is next only inside media).

const DEFAULTS := {
"move_up": [KEY_W, KEY_UP], "move_down": [KEY_S, KEY_DOWN],
"move_left": [KEY_A, KEY_LEFT], "move_right": [KEY_D, KEY_RIGHT],
"sprint": [KEY_SHIFT], "interact": [KEY_E, KEY_ENTER],
"menu": [KEY_ESCAPE], "back": [KEY_ESCAPE],
"workspace_map": [KEY_TAB, KEY_M], "notification_feed": [KEY_N],
"media_console": [KEY_P], "confirm": [KEY_ENTER, KEY_KP_ENTER],
"nav_up": [KEY_UP, KEY_W], "nav_down": [KEY_DOWN, KEY_S],
"nav_left": [KEY_LEFT, KEY_A], "nav_right": [KEY_RIGHT, KEY_D],
"page_up": [KEY_PAGEUP], "page_down": [KEY_PAGEDOWN],
"first": [KEY_HOME], "last": [KEY_END],
"media_toggle": [KEY_SPACE, KEY_E, KEY_ENTER, KEY_KP_ENTER],
"media_next": [KEY_N, KEY_RIGHT, KEY_D],
"media_previous": [KEY_B, KEY_LEFT, KEY_A],
"media_stop": [KEY_X], "media_play": [KEY_KP_0], "media_pause": [KEY_KP_2],
}

static func ensure_registered() -> void:
for action in DEFAULTS:
if not InputMap.has_action(action):
InputMap.add_action(action)
if not InputMap.action_get_events(action).is_empty():
continue
for key in DEFAULTS[action]:
var event := InputEventKey.new()
event.physical_keycode = key
InputMap.action_add_event(action, event)

static func pressed(event: InputEvent, action: StringName) -> bool:
if event is InputEventKey and event.physical_keycode == 0:
# Synthetic/accessibility key events may carry only a logical keycode.
event = event.duplicate()
event.physical_keycode = event.keycode
return event.is_action_pressed(action, false)
75 changes: 41 additions & 34 deletions frontend/godot/scripts/main.gd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
extends Node2D

const Actions = preload("res://scripts/input_actions.gd")
const Overlay = preload("res://ui/overlay_coordinator.gd")
const SessionBinding = preload("res://scripts/session_binding.gd")

@onready var player: CharacterBody2D = $World/Player
Expand All @@ -9,13 +11,25 @@ const SessionBinding = preload("res://scripts/session_binding.gd")
@onready var notification_feed: CanvasLayer = $NotificationFeed
@onready var media_console: CanvasLayer = $MediaConsole

var menu_open := false
var map_open := false
var feed_open := false
var media_open := false
var overlays: RefCounted
# Read-only compatibility views; the coordinator is the only state owner.
var menu_open: bool:
get: return overlays.current == Overlay.Mode.PAUSE
var map_open: bool:
get: return overlays.current == Overlay.Mode.WORKSPACES
var feed_open: bool:
get: return overlays.current == Overlay.Mode.NOTIFICATIONS
var media_open: bool:
get: return overlays.current == Overlay.Mode.MEDIA
var _stations: Array[Node] = []

func _ready() -> void:
Actions.ensure_registered()
overlays = Overlay.new(player, hud, {
Overlay.Mode.WORKSPACES: workspace_map,
Overlay.Mode.NOTIFICATIONS: notification_feed,
Overlay.Mode.MEDIA: media_console,
})
player.interaction_changed.connect(hud.set_interaction_prompt)
player.interaction_requested.connect(_on_interaction_requested)
player.menu_requested.connect(_toggle_menu)
Expand Down Expand Up @@ -52,53 +66,45 @@ func _ready() -> void:
_on_applications_changed(backend.applications)
hud.set_status("VELORA // POCKET TERMINAL")

func _input(event: InputEvent) -> void:
if Actions.pressed(event, "back") or Actions.pressed(event, "menu"):
get_viewport().set_input_as_handled()
_toggle_menu()

func _unhandled_input(event: InputEvent) -> void:
if menu_open or map_open or feed_open or media_open or not event is InputEventKey:
if overlays.current != Overlay.Mode.NONE:
return
if not event.pressed or event.echo:
return
if event.keycode in [KEY_TAB, KEY_M]:
if Actions.pressed(event, "workspace_map"):
get_viewport().set_input_as_handled()
_toggle_workspace_map()
elif event.keycode == KEY_N:
elif Actions.pressed(event, "notification_feed"):
get_viewport().set_input_as_handled()
_toggle_notification_feed()
elif event.keycode == KEY_P:
elif Actions.pressed(event, "media_console"):
get_viewport().set_input_as_handled()
_toggle_media_console()

func _toggle_workspace_map() -> void:
map_open = true
player.set_input_enabled(false)
workspace_map.open()
overlays.toggle(Overlay.Mode.WORKSPACES)

func _on_map_closed() -> void:
map_open = false
player.set_input_enabled(true)
overlays.close(Overlay.Mode.WORKSPACES)

func _toggle_notification_feed() -> void:
feed_open = true
player.set_input_enabled(false)
# Scene-driven refresh: the client fetches once per connection, so the
# panel asks for a fresh single-flight feed whenever it is inspected.
backend.request_notifications()
notification_feed.open()
if not feed_open:
backend.request_notifications()
overlays.toggle(Overlay.Mode.NOTIFICATIONS)

func _on_feed_closed() -> void:
feed_open = false
player.set_input_enabled(true)
overlays.close(Overlay.Mode.NOTIFICATIONS)

func _toggle_media_console() -> void:
media_open = true
player.set_input_enabled(false)
# Scene-driven refresh: the client fetches once per connection, so the
# console asks for a fresh single-flight snapshot whenever it is opened.
backend.request_media_snapshot()
media_console.open()
if not media_open:
backend.request_media_snapshot()
overlays.toggle(Overlay.Mode.MEDIA)

func _on_media_console_closed() -> void:
media_open = false
player.set_input_enabled(true)
overlays.close(Overlay.Mode.MEDIA)

func _on_session_snapshot_changed(snapshot: Dictionary) -> void:
workspace_map.update_session(snapshot)
Expand Down Expand Up @@ -199,6 +205,7 @@ func _on_applications_changed(applications: Array) -> void:
station.bind_application(applications_by_id.get(station.desktop_id, {}))

func _toggle_menu() -> void:
menu_open = not menu_open
player.set_input_enabled(not menu_open)
hud.set_menu_visible(menu_open)
if overlays.current != Overlay.Mode.NONE:
overlays.back()
else:
overlays.open(Overlay.Mode.PAUSE)
28 changes: 15 additions & 13 deletions frontend/godot/scripts/pixel_art.gd
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
class_name VeloraPixelArt
extends RefCounted

const TILE_SIZE := Vector2i(16, 16)
const DEEP_NAVY := Color("0b1020")
const FLOOR_BLUE := Color("17233b")
const FLOOR_LIGHT := Color("1d2c49")
const STEEL_BLUE := Color("293858")
const STEEL_LIGHT := Color("41577c")
const CYAN := Color("41d6c3")
const CYAN_LIGHT := Color("9af4e7")
const AMBER := Color("f5b942")
const RED := Color("e05a67")
const SOFT_WHITE := Color("dce6f2")
const SHADOW := Color("070a13")
const Tokens = preload("res://ui/design_tokens.gd")

const TILE_SIZE := Tokens.TILE_SIZE
const DEEP_NAVY := Tokens.WORLD_BACKGROUND
const FLOOR_BLUE := Tokens.WORLD_FLOOR
const FLOOR_LIGHT := Tokens.WORLD_FLOOR_LIGHT
const STEEL_BLUE := Tokens.WORLD_STEEL
const STEEL_LIGHT := Tokens.WORLD_STEEL_LIGHT
const CYAN := Tokens.WORLD_ACCENT
const CYAN_LIGHT := Tokens.READY
const AMBER := Tokens.WORLD_AMBER
const RED := Tokens.FAILURE
const SOFT_WHITE := Tokens.WORLD_TEXT
const SHADOW := Tokens.WORLD_SHADOW

static func create_tileset() -> TileSet:
var image := Image.create_empty(64, 16, false, Image.FORMAT_RGBA8)
Expand Down Expand Up @@ -130,7 +132,7 @@ static func _draw_wall_tile(image: Image, origin: Vector2i) -> void:
image.fill_rect(Rect2i(origin, TILE_SIZE), DEEP_NAVY)
image.fill_rect(Rect2i(origin + Vector2i(1, 1), Vector2i(14, 14)), STEEL_BLUE)
image.fill_rect(Rect2i(origin + Vector2i(1, 1), Vector2i(14, 3)), STEEL_LIGHT)
image.fill_rect(Rect2i(origin + Vector2i(3, 7), Vector2i(10, 2)), Color("1d2c49"))
image.fill_rect(Rect2i(origin + Vector2i(3, 7), Vector2i(10, 2)), Tokens.WORLD_FLOOR_LIGHT)
image.set_pixelv(origin + Vector2i(3, 12), AMBER)

static func _draw_threshold_tile(image: Image, origin: Vector2i) -> void:
Expand Down
Loading
Loading