Conversation
studio.youtube.com (a Polymer app) leaks `html{color:#fff}` and
`flex:1 0 1e-9px` into our scoped UI, washing out the modal header icons
and inflating the header <section> so content was pushed down with large
gaps. Pin a per-theme base text color and restore the default
`flex:0 1 auto` on scoped flow elements in tailwind.css; add an e2e
host-style-isolation regression net.
Ref #86exw6kme
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# [1.14.0-dev.2](v1.14.0-dev.1...v1.14.0-dev.2) (2026-06-08) ### Bug Fixes * **console-crane:** isolate modal from host-page color/flex CSS leaks ([2b89736](2b89736)), closes [#86exw6kme](https://github.com/codebridger/subturtle-extension-apps/issues/86exw6kme)
The pilotui Select renders its visible trigger button at the bottom of a 4-level wrapper chain, two links of which are display:block, so the bundle selector field rendered a few px shorter than the adjacent lg Save button in SaveWordSectionV2. Lay the SelectPhraseBundleV2 root out as a flex row and stretch every link of the chain so the trigger fills the row height and lines up with Save, in both the plain and freemium (InputGroup) save layouts. (Also carries an in-progress justify-center tweak + reformatting in the same component.) Ref #86exw6kme Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
## [1.14.1-dev.1](v1.14.0...v1.14.1-dev.1) (2026-06-08) ### Bug Fixes * **console-crane:** align bundle selector height with the Save button ([cf057a0](cf057a0)), closes [#86exw6kme](https://github.com/codebridger/subturtle-extension-apps/issues/86exw6kme) * **console-crane:** isolate modal from host-page color/flex CSS leaks ([2b89736](2b89736)), closes [#86exw6kme](https://github.com/codebridger/subturtle-extension-apps/issues/86exw6kme)
A purged/invalid token in chrome.storage.sync made every translation fail with "User not found" (and other token-dependent calls 412) until a full reload. Requests now detect auth-shaped failures, recover the session, and retry once. - isAuthError: detect token failures from the response body (the client discards the HTTP status). Patterns are grounded in the actual modular-rest server output, including the swallowed "Precondition Failed" body for invalid/expired/wrong-signature tokens. - withAuthRetry: reusable wrapper that recovers + retries once on an auth error; wired into TranslateService's three function/run calls. - recoverSession: tears a dead registered session down system-wide via logout() (profile/isLogin/analytics reset + broadcast) then re-auths anonymous; anonymous sessions just re-auth (contained). - single-flight recovery: concurrent failures share ONE loginAnonymous instead of each minting and stranding an anonymous user. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix: self-heal stale auth token on translate instead of failing
## [1.14.1-dev.2](v1.14.1-dev.1...v1.14.1-dev.2) (2026-06-08) ### Bug Fixes * self-heal stale auth token on translate instead of failing ([6ef3766](6ef3766))
|
🎉 This PR is included in version 1.14.1-dev.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
navidshad
left a comment
There was a problem hiding this comment.
Automated PR Review
Primary Task: CU-86exw6kme — Console-crane UI fixes (align bundle selector + isolate modal CSS)
Related tasks from commits: Internal PR #33 / fix: self-heal stale auth token (the auth-recovery work)
Task alignment
Console-crane UI fixes (86exw6kme)
- ✅
fix(console-crane): align bundle selector height with the Save button— flex stretch chain inSelectPhraseBundleV2.vue+ scoped CSS handles both plain and freemium (InputGroup) save layouts. - ✅
fix(console-crane): isolate modal from host-page color/flex CSS leaks—tailwind.csspins a per-theme base color and resetsflex: 0 1 autoon scoped flow elements. - ✅ E2E regression net added (
tests/e2e/host-style-isolation.spec.ts) that reproduces the studio.youtube.com Polymer conditions.
Auth self-heal (stale token)
- ✅ New
src/common/helper/auth-recovery.ts—isAuthError/reauthAnonymously/withAuthRetry/setSessionRecoveryall implemented and well-documented. - ✅
TranslateServicewraps all threefunctionProvider.runcalls withwithAuthRetry. - ✅
modular-rest.tsrefactors the first-session anonymous fallback to the sharedreauthAnonymouslyprimitive, and installsrecoverSessionas the system-wide recovery strategy (logout + reauth for registered users, contained reauth for anonymous). - ✅ Single-flight coalescing (
inflightReauth/inflightRecovery) prevents the "thundering herd of loginAnonymous calls" on a burst of concurrent failures. - ✅ Tests:
tests/auth-recovery.test.ts(new, ~30 cases forisAuthError/reauthAnonymously/withAuthRetry) +recoverSessiondescribe block intests/auth-anon-flow.test.ts+ integration tests intests/translate.service.test.ts.
Commit messages
All three substantive commits are clean:
- ✅
fix: self-heal stale auth token on translate instead of failing— thorough body explaining the mechanism, the server behavior, and the single-flight design. - ✅
fix(console-crane): align bundle selector height with the Save button— explains the 4-level pilotui wrapper chain and why flex stretch was needed. - ✅
fix(console-crane): isolate modal from host-page color/flex CSS leaks— names the specific host (studio.youtube.com), both leak types, and the fix approach. - ✅ Three
chore(release): ...commits are semantic-release auto-generated. Type and format are correct.
Convention check
✅ .subturtle-scope class present on existing mount roots — unaffected.
✅ New CSS in tailwind.css explicitly carries .subturtle-scope so the PostCSS prefixer's idempotent guard leaves them as-is (CLAUDE.md rule 1).
✅ No rem in new hand-rolled CSS; hardcoded hex colors are used instead of hand-rolled rem (CLAUDE.md rule 2).
✅ No lazy/dynamic imports added (CLAUDE.md bundle convention).
✅ Late-binding via setSessionRecovery correctly avoids a circular import (modular-rest → auth-recovery → modular-rest). Design rationale documented inline.
✅ Extensive multi-line docstrings in auth-recovery.ts are appropriate per CLAUDE.md's override: "Multi-line comments and docstrings are fine — encouraged, even, where the why is non-obvious."
Minor items (non-blocking):
-
PR body uses placeholder task IDs. The body lists
#33(a GitHub PR number, not a ClickUp ID) and#console-crane-ui-fixes(invalid). The real ClickUp task86exw6kmeis referenced in the commit messages but not mentioned by name/URL in the PR description. Worth cleaning up the body for traceability. -
justify-centeronInputGroupis labelled "in-progress" in the commit body. The commit foralign bundle selector heightnotes "Also carries an in-progress justify-center tweak + reformatting in the same component." If this centers the search + Create row in the bundle dropdown header, it's a UI change that doesn't seem obviously incomplete — but calling it "in-progress" in the commit message is ambiguous. Confirm whether this is intentional and finished. -
CLAUDE.mdtest-count comment is now stale. The doc records "138 unit / component tests across 19 files; 16 E2E specs across 6 files". This PR addstests/auth-recovery.test.ts(new file, ~30+ cases), extendsauth-anon-flow.test.ts+translate.service.test.ts, and addstests/e2e/host-style-isolation.spec.ts(new E2E file). A follow-up CLAUDE.md update would keep the docs accurate.
Verdict
APPROVE
The implementation is solid: the auth self-heal covers the exact failure paths derived from the server source (not guessed), the single-flight recovery prevents session storms, the CSS isolation fixes are well-scoped and low-risk, and the test coverage is thorough across unit, integration, and E2E layers. The three minor items above are documentation-level and do not affect correctness or maintainability.
Generated by Claude Code
|
🎉 This PR is included in version 1.14.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🏷️ PR Title:
Fix self-healing of stale auth token on translate and UI improvements in console-crane
📋 Summary
This PR addresses an issue where translation requests failed due to stale authentication tokens by implementing a self-heal mechanism to refresh the token automatically. Additionally, it includes UI fixes for the console-crane module: aligning the bundle selector height with the Save button and isolating modal styles to prevent CSS leaks from the host page.
🔗 Related Tasks
#33 - Fix self-heal stale auth token on translate to prevent failure
#console-crane-ui-fixes - Align bundle selector height with Save button and isolate modal CSS
📝 Additional Details
📜 Commit List
6ef3766 fix: self-heal stale auth token on translate instead of failing
cf057a0 fix(console-crane): align bundle selector height with the Save button
2b89736 fix(console-crane): isolate modal from host-page color/flex CSS leaks
c76121e chore(release): 1.14.0-dev.2 [skip ci]
16a6feb chore(release): 1.14.1-dev.1 [skip ci]
b1c5a13 Merge remote-tracking branch 'origin/main' into dev
98472c1 Merge pull request #33 from codebridger/fix/translate-auth-self-heal