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
1 change: 0 additions & 1 deletion frontend2/src/pages/play/components/play-action-jump.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export function PlayActionJumpButton({
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: 12 }}
transition={transitions.snap}
onPointerDown={onClick}
onClick={onClick}
aria-label={t("play.action_jump_title")}
title={t("play.action_jump_title")}
Expand Down
4 changes: 0 additions & 4 deletions frontend2/src/shared/ui/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export function Header({
const { lang, setLang, t } = useLanguage()
const [menuOpen, setMenuOpen] = useState(false)
const accountName = auth.user?.display_name?.trim() || "reader"
const accountInitial = accountName.slice(0, 1).toUpperCase()
const accountLabel = t("header.account")

const handleLogin = () => {
Expand Down Expand Up @@ -61,9 +60,6 @@ export function Header({
aria-expanded={menuOpen}
title={accountName}
>
<span className="topbar-account__avatar" aria-hidden>
{accountInitial}
</span>
<span className="topbar-account__label">{accountLabel}</span>
</button>
{menuOpen ? (
Expand Down
26 changes: 22 additions & 4 deletions tests/test_author_product_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,24 @@ def test_author_job_service_loading_cards_are_stage_adaptive() -> None:
import rpg_backend.author.jobs as jobs_module

service = AuthorJobService()
settings = get_settings()
uncached_input_tokens = max(240 - 160 - 30, 0)
estimated_cost_rmb = (
uncached_input_tokens * settings.responses_input_price_per_million_tokens_rmb / 1_000_000
+ 160
* settings.responses_input_price_per_million_tokens_rmb
/ 1_000_000
* settings.responses_session_cache_hit_multiplier
+ 30
* settings.responses_input_price_per_million_tokens_rmb
/ 1_000_000
* settings.responses_session_cache_creation_multiplier
+ 60 * settings.responses_output_price_per_million_tokens_rmb / 1_000_000
)
estimated_cost_usd = round(estimated_cost_rmb, 6) * settings.responses_usd_per_rmb

def expected_token_budget(total_tokens: int) -> str:
return f"{total_tokens} total tokens · USD {estimated_cost_usd:.6f} est."

def build_record(stage: str, stage_index: int, total_tokens: int | None) -> jobs_module._AuthorJobRecord:
metrics = None
Expand Down Expand Up @@ -622,31 +640,31 @@ def build_record(stage: str, stage_index: int, total_tokens: int | None) -> jobs
225,
{"theme", "structure", "working_title", "tone", "story_premise", "story_stakes", "generation_status", "token_budget"},
"Story frame drafted. Title, premise, and stakes are set.",
"225 total tokens · USD 0.000020 est.",
expected_token_budget(225),
),
(
"cast_ready",
6,
300,
{"theme", "structure", "working_title", "tone", "story_premise", "story_stakes", "cast_count", "cast_anchor", "generation_status", "token_budget"},
"Cast roster drafted. NPC tensions are in place.",
"300 total tokens · USD 0.000020 est.",
expected_token_budget(300),
),
(
"beat_plan_ready",
7,
360,
{"theme", "structure", "working_title", "tone", "story_premise", "story_stakes", "cast_count", "cast_anchor", "beat_count", "opening_beat", "final_beat", "generation_status", "token_budget"},
"Beat plan drafted. Main progression is mapped.",
"360 total tokens · USD 0.000020 est.",
expected_token_budget(360),
),
(
"completed",
10,
570,
{"theme", "structure", "working_title", "tone", "story_premise", "story_stakes", "cast_count", "cast_anchor", "beat_count", "opening_beat", "final_beat", "generation_status", "token_budget"},
"Bundle complete. Story package is ready.",
"570 total tokens · USD 0.000020 est.",
expected_token_budget(570),
),
]

Expand Down
2 changes: 2 additions & 0 deletions tests/test_navigation_mental_model_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,8 @@ def test_home_topbar_account_ia_keeps_creation_in_hero() -> None:
assert "topbar-account__label" in header
assert "topbar-lang" in header
assert "topbar-account" in header
assert "accountInitial" not in header
assert 'className="topbar-account__avatar"' not in header
assert '"header.account": "Account"' in strings
assert '"header.account": "账号"' in strings

Expand Down
3 changes: 2 additions & 1 deletion tests/test_play_direction_a_editorial_primitives_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -2550,7 +2550,8 @@ def test_play_has_jump_to_action_affordance_when_choices_are_below_viewport() ->
assert "data-play-action-jump-stage={stage}" in action_jump
assert 'data-play-action-jump-compact={compactJump ? "true" : "false"}' in action_jump
assert 'data-play-action-jump-detail="true"' in action_jump
assert "onPointerDown={onClick}" in action_jump
assert "onPointerDown={onClick}" not in action_jump
assert "onClick={onClick}" in action_jump
assert "isPlayElementAwayFromViewport" in action_jump_utils
assert "scrollToPlayActionArea" in action_jump_utils
assert "scrollToPlayImpactSummaryOrAction" in action_jump_utils
Expand Down