Rebrand to TerKix + PWA, Gemini API improvements, UI & storage refactor#8
Rebrand to TerKix + PWA, Gemini API improvements, UI & storage refactor#8Huynhthuongg wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
📝 WalkthroughWalkthroughBản cập nhật toàn diện để đổi tên thương hiệu từ RKix sang TerKix, bổ sung khả năng PWA với Service Worker, triển khai lớp lưu trữ được gõ kiểu, hỗ trợ cài đặt PWA và UI preferences, cải tiến điều hướng lịch sử lệnh, và tối ưu hóa tích hợp Gemini API. ChangesTerKix Terminal OS — Cập nhật toàn diện với PWA, persistence, và tích hợp API
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Warning Review ran into problems🔥 ProblemsLinked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Kilo Code Review could not run — your account is out of credits. Add credits or switch to a free model to enable reviews on this change. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f722412bb6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
5 issues found across 20 files
You’re at about 99% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
Actionable comments posted: 15
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@index.html`:
- Line 11: The apple-touch-icon link currently points to an SVG
(href="/terkix-logo.svg"), which may not work on older iOS versions; add a PNG
fallback by including a second link rel="apple-touch-icon" that points to a
180x180 PNG (e.g., "/terkix-logo-180.png") alongside or before the SVG link, and
keep the existing SVG reference for modern browsers so older iOS devices get the
PNG while newer ones can use the SVG.
In `@public/manifest.webmanifest`:
- Line 8: The manifest currently hard-locks orientation via the "orientation":
"portrait-primary" setting in public/manifest.webmanifest; remove or relax this
constraint by either deleting the "orientation" entry or replacing
"portrait-primary" with a more permissive value (e.g., "any" or allowing both
portrait/landscape) so tablets can use landscape modes when needed; update the
manifest key "orientation" accordingly and verify the change works on target
devices.
- Around line 20-35: The manifest defines shortcuts with ?section=terminal and
?section=files but the app doesn't read the query string; in src/App.tsx add a
useEffect on mount that reads window.location.search (or URLSearchParams) to
extract the "section" param, map "terminal"->"terminal" and "files"->"files"
(fallback to "terminal" for invalid/missing values) and call
setCurrentSection(mappedSection); ensure this logic runs once on mount and does
not override user navigation/state thereafter.
In `@public/sw.js`:
- Line 1: The CACHE_NAME constant is set to "terkix-shell-v2" which is confusing
for a first PWA release; change the value of CACHE_NAME in public/sw.js from
"terkix-shell-v2" to "terkix-shell-v1" (or another v1 identifier you choose) and
update any references that use CACHE_NAME (e.g., cache open/activate/cleanup
logic) so the service worker consistently uses the new version string; if you
intentionally had a prior v1 in testing, leave v2 and add a comment explaining
that decision.
- Around line 29-42: The staleWhileRevalidate function can resolve to undefined
when both the cache miss (cached is undefined) and the network fetch fails;
update staleWhileRevalidate to return a valid Response in that edge case by
falling back to a pre-cached SPA asset (e.g., index.html) or a known fallback
Response. Specifically, after computing cached and network (the promise chain
that uses .catch(() => cached)), ensure the function awaits the network promise
and if the result is still falsy, read the fallback Response from
caches.open(CACHE_NAME).then(c => c.match('/index.html')) (or your chosen
fallback key) and return that instead so staleWhileRevalidate never returns
undefined.
- Line 2: SHELL_ASSETS currently lists only a few static entries and won't
precache build-generated JS/CSS/font bundles; update the service worker
bootstrap (the file containing SHELL_ASSETS) to stop manually extending that
array and instead inject the real build assets at build time — use Workbox
injectManifest or read the asset-manifest produced by your bundler to generate
the precache list (include hashed JS/CSS bundles and any external fonts/CSS
referenced by index.html) and replace SHELL_ASSETS with that generated list so
cold-start offline works reliably.
In `@README.md`:
- Around line 17-18: Add an "engines" field to package.json to match the README
requirement (e.g., set "node": ">=22" and "npm": ">=10") so npm will warn on
incompatible runtimes; update or validate any existing package.json-related
metadata (scripts or CI checks) that may rely on Node version and ensure the
README and package.json remain consistent by reflecting the same minimum
versions.
In `@server.ts`:
- Around line 249-253: The catch block handling Gemini Command processing
currently returns error.message to the client; change it to return a generic
client-safe error payload (e.g. error: "An error occurred while processing your
command.", code: "GEMINI_PROCESSING_ERROR") while keeping the detailed
console.error("Gemini Command processing failed:", error) for server logs;
update the res.status(500).json call in the catch block (the error handling in
server.ts) to the generic message and code and remove direct exposure of
error.message from the response.
In `@src/App.tsx`:
- Around line 328-346: The handleInstallApp function lacks error handling around
the async PWA install calls: wrap the installPromptEvent.prompt() and awaiting
installPromptEvent.userChoice in a try-catch, handle rejected promises and user
cancellation by updating setPwaInstallState (e.g., "failed" or keep "ready"),
call setInstallPromptEvent(null) on finalization, and push a descriptive system
line to setTerminalLines with the error or cancellation outcome; use the
existing symbols installPromptEvent, setPwaInstallState, setInstallPromptEvent,
and setTerminalLines when implementing this change.
- Around line 152-157: The current validator passed to readJsonStorage for the
projects state only checks id and files and can allow corrupt/incomplete Project
objects; create a full type guard (e.g., isProject and isProjectArray) that
validates all required Project fields (id, name, description, createdAt, status,
activeBranch, branches as array, commitHistory as array, deployments as array,
files as array, etc. matching the Project type from types.ts) and use that guard
as the predicate argument to readJsonStorage when initializing projects; ensure
the guard is exported/located near types.ts so it can be reused and that the
initializer falls back to PRESET_PROJECTS when validation fails.
In `@src/main.tsx`:
- Around line 13-17: Thêm bắt lỗi khi đăng ký service worker: trong khối where
you call navigator.serviceWorker.register('/sw.js') (inside the
window.addEventListener('load', ...) and guarded by 'serviceWorker' in navigator
&& !isViteDevServer) xử lý promise trả về bằng then/catch hoặc async/await và
log lỗi rõ ràng (ví dụ console.error hoặc logger) bao gồm thông điệp ngữ cảnh
"Failed to register service worker" kèm chi tiết lỗi, để dễ debug khi đăng ký
navigator.serviceWorker.register thất bại.
- Line 12: Replace the manual cast of import.meta by adding Vite types and
handle SW registration errors: add a vite-env.d.ts or include "types":
["vite/client"] in tsconfig so import.meta.hot is recognized and remove the cast
around isViteDevServer (symbol: isViteDevServer / import.meta.hot), and update
the service worker registration call (symbol:
navigator.serviceWorker.register('/sw.js')) to attach a .catch that logs the
error (use existing logger or console.error) so registration failures are
surfaced.
In `@src/utils/storage.ts`:
- Around line 14-19: When migrating a value inside the legacyKeys loop in
src/utils/storage.ts, remove the old entry to avoid duplicate data: after
retrieving legacyValue and writing it to the new key with
window.localStorage.setItem(key, legacyValue), call
window.localStorage.removeItem(legacyKey) before returning legacyValue; this
change touches the legacyKeys iteration and uses legacyKey, key,
getItem/setItem/removeItem to locate and remove the migrated item.
- Around line 41-47: The code unsafely casts `parsed` (unknown) to `T` when
`validator` is undefined (see `validator`, `parsed`, and the `return parsed as
T` line); either make the validator required for non-primitive types or add
runtime safeguards/overloads: (1) require a `validator` parameter (or
throw/return `fallback`) whenever `T` could be complex, or (2) provide two
overloads—one without a validator limited to primitive types and one that
requires a runtime type guard—plus update JSDoc to state the caller
responsibility; implement one of these options and remove the unconditional
`return parsed as T` cast so parsed is only returned after validation or
explicit primitive-safe path.
- Around line 68-72: The function readNumberStorage currently uses
Number.parseInt so it drops fractional parts; replace the integer parse with a
floating-point parse (e.g., use Number.parseFloat(rawValue) or
parseFloat(rawValue)) and keep the Number.isFinite(parsed) check so non-numeric
values fall back to the provided fallback; update the implementation in
readNumberStorage (which calls readStringStorage) accordingly or alternatively
rename the function to readIntStorage if you intend to keep integer-only
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 29ef7e29-eab9-4cf8-9ab4-00bb11c4e42a
⛔ Files ignored due to path filters (2)
package-lock.jsonis excluded by!**/package-lock.jsonpublic/terkix-logo.svgis excluded by!**/*.svg
📒 Files selected for processing (18)
.env.exampleREADME.mdindex.htmlmetadata.jsonpackage.jsonpublic/manifest.webmanifestpublic/sw.jsserver.tssrc/App.tsxsrc/components/ContactsManager.tsxsrc/components/DashboardOverview.tsxsrc/components/PluginManager.tsxsrc/components/TelemetryD3Chart.tsxsrc/data/presets.tssrc/index.csssrc/main.tsxsrc/utils/storage.tsvite.config.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> Signed-off-by: Huỳnh Thương <252359928+Huynhthuongg@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5298720d17
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Meticulous was unable to execute a test run for this PR because the most recent commit is associated with multiple PRs. To execute a test run, please try pushing up a new commit that is only associated with this PR. Last updated for commit |
Generated by v0 [v0 Session](https://v0.app/chat/xVL4WU8pTgL) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Initialize the repository with a base project structure and configuration to enable local development and deployment. Adds standard configs and scripts so the project builds and runs out of the box. <sup>Written for commit 9357c26. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/Huynhthuongg/Terkix/pull/19?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Motivation
Description
public/terkix-logo.svg,manifest.webmanifest,sw.jsservice worker, register service worker insrc/main.tsx, and updateindex.html/README.md/metadata.jsonand.env.exampleto includeGEMINI_MODELandPORTnotes.server.tsto load env viadotenv, expose/api/health, addGEMINI_MODELoverride, validate/normalize request payloads, un-fence and parse JSON outputs from Gemini, and use the configured model when calling@google/genai.src/App.tsxenhancements including PWA install prompt handling, command history with up/down recall, thinking-mode trace, UI preference types and persistence, offline/online state handling, export snapshot feature, many UI copy/branding updates, and service worker registration.src/utils/storage.tshelpers for robust read/write/legacy-key migration, updatepackage.json/package-lock.jsonmetadata and dev deps ordering, and wire Vite config/tailwind/react plugin entries.Testing
npm run typecheckto ensure typings and new storage utilities integrate properly (no type errors reported).npm run buildto verify client bundling and server bundling succeed (build completed)./api/healthand verifying a JSON response that includes the configuredgeminiModel(responded as expected).Codex Task
Summary by cubic
Rebranded the app to TerKix and shipped an installable PWA with offline shell caching. Hardened the Gemini command API, added persisted preferences/history, and delivered a compact mobile cockpit UI.
New Features
public/manifest.webmanifest,public/sw.js, updatedindex.htmlmeta/theme/Apple tags and icons, and registered the service worker only outside Vite dev; offline shell + install prompts..envloading viadotenv,GEMINI_MODELoverride (defaultgemini-2.5-flash),PORTsupport,/api/health, stricter request schema validation, and safer un-fencing/JSON parsing with@google/genai.src/utils/storage.tsfor robust read/write and legacy-key migration.public/terkix-logo.svg, copy/CSS refresh, updatedREADME.mdandmetadata.json(adds microphone permission), package renamed toterkix-terminal-os(v1.0.5), and scripts updated (preview; lint runstypecheck).Migration
GEMINI_API_KEY(required), optionalGEMINI_MODELandPORT.npm run buildthennpm start; dev vianpm run dev; preview withnpm run preview.Written for commit 4771564. Summary will update on new commits.