-
Notifications
You must be signed in to change notification settings - Fork 0
Fix early-game UX issues: form placeholders, time visibility, completion feedback #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6734d02
Initial plan
Copilot cbaa393
Fix prefilled form fields, add tick countdown, improve workforce UI e…
Copilot 616681c
Add toast notifications for research and production completion
Copilot 70cdc63
Fix TypeScript errors in toast notifications
Copilot 58a8a4e
Add release entry for UX improvements
Copilot f453975
Remove prefilled allocation percentages from workforce page initial s…
Copilot 411375e
Fix capacity delta input reset to empty string after submission
Copilot b1ec0f1
Apply code review feedback: improve accessibility, fix countdown boun…
Copilot d657363
Update design guidelines documentation with new UX patterns
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
.releases/unreleased/20260218131646-fix-ux-data-visibility-issues.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| type: minor | ||
| area: web | ||
| summary: Fix early UX and data visibility issues (forms, time display, workforce clarity, completion feedback) | ||
| --- | ||
|
|
||
| - Replace prefilled form values with descriptive placeholders in market orders, production jobs, and workforce | ||
| - Add tick countdown timer showing "Next week in Xs" with tooltip explaining time progression | ||
| - Reduce health polling from 3s to 15s to minimize UI refresh indicator blinking | ||
| - Add comprehensive workforce explanations (capacity impact, allocation labels, help text) | ||
| - Add toast notifications for research and production job completions with unlocked recipe details | ||
| - Improve overall system transparency and onboarding clarity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| "use client"; | ||
|
|
||
| import { useEffect, useState } from "react"; | ||
| import { Clock } from "lucide-react"; | ||
| import { InlineHelp } from "@/components/ui/inline-help"; | ||
| import { useWorldHealth } from "./world-health-provider"; | ||
|
|
||
| // Default tick interval (60 seconds) - matches worker default configuration | ||
| // TODO: Get this from API configuration endpoint | ||
| const DEFAULT_TICK_INTERVAL_MS = 60_000; | ||
|
|
||
| export function TickCountdown() { | ||
| const { health } = useWorldHealth(); | ||
| const [secondsRemaining, setSecondsRemaining] = useState<number | null>(null); | ||
|
|
||
| useEffect(() => { | ||
| if (!health?.lastAdvancedAt) { | ||
| setSecondsRemaining(null); | ||
| return; | ||
| } | ||
|
|
||
| const updateCountdown = () => { | ||
| const lastAdvancedTime = new Date(health.lastAdvancedAt!).getTime(); | ||
| const now = Date.now(); | ||
| const elapsed = now - lastAdvancedTime; | ||
| const remaining = | ||
| (DEFAULT_TICK_INTERVAL_MS - (elapsed % DEFAULT_TICK_INTERVAL_MS)) % | ||
| DEFAULT_TICK_INTERVAL_MS; | ||
| setSecondsRemaining(Math.ceil(remaining / 1000)); | ||
| }; | ||
|
|
||
| updateCountdown(); | ||
| const interval = setInterval(updateCountdown, 1000); | ||
|
|
||
| return () => clearInterval(interval); | ||
| }, [health?.lastAdvancedAt, health?.currentTick]); | ||
|
|
||
| if (secondsRemaining === null) { | ||
| return null; | ||
| } | ||
|
|
||
| const helpText = `Time progression: The simulation advances in discrete weeks (ticks). Each week represents ${DEFAULT_TICK_INTERVAL_MS / 1000} seconds of real time. Production jobs, research, and shipments complete when the required number of weeks pass.`; | ||
|
|
||
| return ( | ||
| <div className="inline-flex items-center gap-1 text-xs text-muted-foreground"> | ||
| <Clock className="h-3.5 w-3.5" /> | ||
| <span title={helpText}> | ||
| Next week in {secondsRemaining}s | ||
| </span> | ||
| <InlineHelp label={helpText} /> | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.