Skip to content

TerKix: rebrand UI, PWA & assets; enhance server Gemini API, workspace schema, and local storage utilities#16

Open
Huynhthuongg wants to merge 3 commits into
mainfrom
codex/review-and-update-project-setup-16uk0n
Open

TerKix: rebrand UI, PWA & assets; enhance server Gemini API, workspace schema, and local storage utilities#16
Huynhthuongg wants to merge 3 commits into
mainfrom
codex/review-and-update-project-setup-16uk0n

Conversation

@Huynhthuongg

@Huynhthuongg Huynhthuongg commented Jun 7, 2026

Copy link
Copy Markdown
Member

Motivation

  • Rebrand and consolidate the project as "TerKix Terminal OS" (previously RKix) with a polished PWA/mobile-first terminal UX and consistent naming across server and client.
  • Improve the server-side Gemini command endpoint to support model override, structured request parsing, more robust JSON parsing, and a health endpoint for runtime checks.
  • Add offline-capable shell caching, PWA manifest, logo asset, and service-worker registration to enable installable/offline experiences.
  • Move localStorage handling into a small safe utility and add UI preference and command-history persistence for a better developer experience.

Description

  • Rebrand and content: update strings and metadata across the app and docs (README, metadata.json, UI text) from RKix → TerKix and add a detailed README describing the workspace, env vars, and commands.
  • PWA & assets: add public/manifest.webmanifest, public/sw.js, and public/terkix-logo.svg, update index.html (meta, icons) and register the service worker in src/main.tsx.
  • Server & Gemini improvements: in server.ts add GEMINI_MODEL env override, PORT support, /api/health endpoint, input interfaces, normalizeFiles and robust parseGeminiJson helpers, switch AI model to use GEMINI_MODEL, update system instructions and response schema, and improve error handling/logging.
  • Frontend UX & state: large App refactor (src/App.tsx) to support PWA install prompt handling, responsive/mobile-tailored UI, command history navigation, thinking-mode traces, UI preference persistence, export snapshot, many UI refinements and new quick actions.
  • Local storage utilities: add src/utils/storage.ts with readJsonStorage, readStringStorage, readNumberStorage, and writeStorage, and migrate usages to safer helpers (renaming keys to terkix_* while honoring legacy keys where applicable).
  • Styling & visuals: extend src/index.css with TerKix-specific visual helpers, add a terminal-glass/grid background, and adjust responsive rules; add public/manifest.webmanifest and other assets for PWA behavior.
  • Tooling & package metadata: update package.json and package-lock.json (name → terkix-terminal-os, bump version, dev deps ordering) and add scripts (preview, typecheck) and description.

Testing

  • Ran TypeScript validation via npm run typecheck (alias tsc --noEmit); the codebase typechecks successfully.
  • Performed a production build with npm run build to ensure bundling of client and server artifacts; build completed successfully.

Codex Task


Summary by cubic

Rebrand the app to TerKix and ship an installable PWA with offline shell caching; the server Gemini endpoint now supports model overrides, structured parsing, and health checks with persistent UI/history via safer storage. The UI adds a compact dashboard, improved mobile fit, and an enhanced rainbow input dock effect.

  • New Features

    • Rebrand to TerKix across UI, assets, metadata, and README; new logo/theme; package renamed to terkix-terminal-os.
    • PWA: manifest + service worker with offline shell caching; SW registered in app.
    • Server Gemini: support GEMINI_MODEL and PORT, add /api/health, structured request types, robust JSON parsing, and better error logging.
    • Terminal/UI: command history recall, install prompt, quick actions, thinking traces, snapshot export; input dock stays visible on mobile with enhanced rainbow effect; compact dashboard and slightly scaled mobile frame.
    • Storage: safe read*/writeStorage helpers; persist UI preferences and command history; migrate keys to terkix_* with legacy fallback.
  • Migration

    • Environment: set GEMINI_API_KEY; optional GEMINI_MODEL and PORT; update APP_URL if needed.
    • Service worker: if the UI looks stale after deploy, hard refresh to update the terkix-shell-v2 cache.
    • Storage: legacy keys auto-migrate; no manual action required.

Written for commit e297a69. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
terkix Ready Ready Preview, Comment, Open in v0 Jun 7, 2026 5:22pm

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

PR này thực hiện chuyển đổi toàn bộ nhận diện từ RKix sang TerKix Terminal OS kèm theo cơ sở hạ tầng PWA, hệ thống lưu trữ dữ liệu cân tiến, và cải thiện API Gemini backend với xác thực và schema tốt hơn.

Changes

Chuyển đổi TerKix Terminal OS và Tích hợp PWA

Layer / File(s) Summary
Cấu hình dự án và Metadata
.env.example, README.md, index.html, metadata.json, package.json, vite.config.ts
Cập nhật metadata dự án, biến môi trường (GEMINI_MODEL, PORT), tài liệu hướng dẫn thiết lập/chạy, các thẻ meta HTML (tiêu đề, manifest, icon), và comment cấu hình Vite.
Hệ thống Lưu trữ Dữ liệu Browser
src/utils/storage.ts
Thêm module tiện ích đọc/ghi localStorage với readJsonStorage, readStringStorage, readNumberStorage, và writeStorage, hỗ trợ fallback, xác thực dữ liệu, và di chuyển từ khóa legacy.
Tích hợp PWA và Service Worker
public/manifest.webmanifest, public/sw.js, src/main.tsx
Thêm manifest PWA (metadata, shortcuts, icon), Service Worker với caching strategies (network-first cho navigation, stale-while-revalidate cho GET), và đăng ký SW có điều kiện (không ở dev server).
Server Express và API Gemini
server.ts
Cấu hình PORT từ env, khởi tạo Gemini client qua lazy helper getGenAI(), thêm typed interfaces cho request/response, helper normalizeFiles()parseGeminiJson(), cập nhật endpoint /api/gemini/command với workspace context chuẩn hóa, schema với field language bắt buộc cho file tạo mới, và SPA fallback routing.
Ứng dụng Lõi: Quản lý Trạng thái và Terminal
src/App.tsx (import, preferences, init, PWA, state, effects)
Thêm TerKixUiPreferences type-guard, khởi tạo state persistence mới qua terkix_* keys, xử lý sự kiện PWA beforeinstallprompt/appinstalled, thêm recallCommandHistory() cho phím ↑/↓, đồng bộ hóa state sang storage qua useEffect, cập nhật dữ liệu contacts/plugin/gemini theo TerKix.
Render Giao diện App và Overlay UI
src/App.tsx (root, dashboard, sidebar, command center)
Cập nhật root element/class sang terkix-*, thay logo/banner dashboard layout, cập nhật legacy sidebar ID/footer, thay command center/dock bàn phím ảo layout, cập nhật terminal log rendering (prompt prefix, warning styling, thinking indicator), status bar online/offline.
Cập nhật Thành phần UI và Styling
src/components/DashboardOverview.tsx, src/components/ContactsManager.tsx, src/components/PluginManager.tsx, src/components/TelemetryD3Chart.tsx, src/data/presets.ts, src/index.css
Cập nhật layout/className thành phần (banner, metrics grid, presets, project panel, agent matrix), cập nhật email/author/comment theo TerKix, thêm CSS toàn bộ cho grid background, command deck glow, terminal glass, layout responsive, và media queries cho mobile/small-height.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 TerKix bây giờ sáng lên,
Từ RKix cũ chuyển thành,
PWA service worker nhem,
Storage, server, UI tươm,
Terminal OS em rạng rỡ!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Tiêu đề rõ ràng tóm tắt các thay đổi chính: rebrand sang TerKix, thêm PWA & assets, cải thiện Gemini API và utilities lưu trữ.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description clearly relates to the changeset, detailing the rebrand from RKix to TerKix, PWA additions, server improvements, and frontend refactoring across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/review-and-update-project-setup-16uk0n
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/review-and-update-project-setup-16uk0n
  • 🛠️ Aethon

Warning

Review ran into problems

🔥 Problems

Linked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped Aethon/backend-api.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kilo-code-bot

kilo-code-bot Bot commented Jun 7, 2026

Copy link
Copy Markdown

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a3e3e5d41

ℹ️ 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".

Comment thread package.json
Comment thread src/utils/storage.ts
Comment thread public/sw.js
@Huynhthuongg Huynhthuongg added bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers invalid This doesn't seem right question Further information is requested wontfix This will not be worked on v0 labels Jun 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🤖 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: Replace the apple-touch-icon reference pointing to an SVG with a PNG
file to avoid iOS home screen issues: update the <link rel="apple-touch-icon"
href="/terkix-logo.svg" /> entry so it points to a PNG (e.g.,
"/terkix-logo.png") and consider adding an explicit sizes attribute (e.g.,
sizes="180x180") to the same <link> element to ensure correct icon sizing on
iOS.

In `@public/sw.js`:
- Around line 21-23: In the networkFirst handler in sw.js, avoid caching error
or redirect responses: before calling cache.put(request, response.clone()) check
the fetched response (response) is a successful one (e.g., response.ok === true
and not a redirected/error response) and only then write to the cache; update
the code around cache.put and the fetch result to conditionally cache successful
responses.

In `@server.ts`:
- Around line 243-248: The parsed Gemini response (parseGeminiJson(resultText))
is sent to the client without validation and can be missing expected fields
(e.g. agentWorkflow), causing client crashes when it assumes agentWorkflow is an
array; after parsing resultText call parseGeminiJson, validate that the returned
value is an object and that parsed.agentWorkflow exists and is an Array (use
Array.isArray(parsed.agentWorkflow)); if validation fails, either throw a
controlled error or return a safe fallback JSON (e.g. { agentWorkflow: [] } or
an HTTP 400/500 with an error message) before calling res.json; update the logic
around resultText / parseGeminiJson to perform this check and reference
parsed.agentWorkflow and response.text in your change.
- Around line 80-88: parseGeminiJson currently only strips ``` fences at string
ends so it fails if the JSON code block is embedded; update parseGeminiJson to
first search for a fenced JSON block anywhere in the input (e.g. using a regex
that captures the inner group like /```(?:json)?\s*([\s\S]*?)\s*```/i) and set
unfenced to that captured group trimmed when present, otherwise fall back to the
original trimmed text, then pass unfenced to JSON.parse; keep references to the
parseGeminiJson function and the unfenced variable when making the change.

In `@src/App.tsx`:
- Around line 361-364: Wrap the call to installPromptEvent.prompt() in a
try/catch to prevent unhandled promise rejections: await
installPromptEvent.prompt() should be inside try, then read
installPromptEvent.userChoice and call setPwaInstallState(choice.outcome ===
"accepted" ? "installed" : "ready") and setInstallPromptEvent(null) in the
success path; in the catch path log the error (or swallow) and ensure you call
setPwaInstallState("ready") and setInstallPromptEvent(null) so state stays
consistent if prompt() rejects.
- Around line 570-575: When the activeProject has no files the UI still keeps
the stale selectedFilePath and editedCode; update the logic around writeStorage
and setSelectedFilePath so that in the case activeProject is null or
activeProject.files.length === 0 you explicitly clear the editor state (call
setSelectedFilePath('') or null and call setEditedCode('') or appropriate reset)
instead of only setting selectedFilePath when files exist; locate the block
using writeStorage, activeProject, setSelectedFilePath and setEditedCode and add
the else branch that resets these values to avoid showing old content after the
last file is deleted.
- Around line 153-156: The validator passed to
readJsonStorage("terkix_projects", PRESET_PROJECTS, ...) is too loose—update the
inline type guard used in readJsonStorage<Project[]> so each item not only has
string id and array files but also validates activeBranch (string or
null/undefined as used by the app), commitHistory (Array), and deployments
(Array), and ensure files elements are the expected shape (e.g., objects with
required properties used elsewhere); modify the anonymous predicate (the
(value): value is Project[] => ...) to check Array.isArray(value) &&
value.every(item => typeof item.id === "string" && Array.isArray(item.files) &&
(typeof item.activeBranch === "string" || item.activeBranch == null) &&
Array.isArray(item.commitHistory) && Array.isArray(item.deployments) &&
item.files.every(f => /* check file shape used by code */ true)) so
legacy/corrupt entries are rejected and PRESET_PROJECTS fallback is used.

In `@src/index.css`:
- Around line 163-166: The rules for .terkix-command-deck and
.terkix-dashboard-compact currently use zoom: 0.88 which can change layout
footprint; replace it with a safer approach depending on intent: if you only
need a visual scale, swap to transform: scale(0.88) and set an appropriate
transform-origin (e.g., top left) and adjust surrounding spacing to avoid
overlap; if you need stable layout sizing, remove zoom and instead make these
components responsive via sizing (adjust font-size/root rem, use clamp(), or use
vw/vh-based widths/heights) so reflow remains correct; update the
.terkix-command-deck and .terkix-dashboard-compact rules accordingly and test
across target mobile breakpoints/Chrome Android/ Safari iOS/Firefox Android.

In `@src/utils/storage.ts`:
- Line 6: The guard function isBrowserStorageAvailable currently reads
window.localStorage directly which can throw in restricted/privacy modes; wrap
the access in a try/catch inside isBrowserStorageAvailable so any thrown
exceptions are caught and the function returns false as a safe fallback, e.g.,
try to access window and window.localStorage and optionally call a simple
getItem/setItem probe, returning true only on success and false on error; update
any callers that assumed it never throws (none should) and ensure the function
name isBrowserStorageAvailable remains the single point of this safe check.
🪄 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: 0292502c-6134-4da2-a6c9-1120a98499ac

📥 Commits

Reviewing files that changed from the base of the PR and between d230678 and 5a3e3e5.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • public/terkix-logo.svg is excluded by !**/*.svg
📒 Files selected for processing (18)
  • .env.example
  • README.md
  • index.html
  • metadata.json
  • package.json
  • public/manifest.webmanifest
  • public/sw.js
  • server.ts
  • src/App.tsx
  • src/components/ContactsManager.tsx
  • src/components/DashboardOverview.tsx
  • src/components/PluginManager.tsx
  • src/components/TelemetryD3Chart.tsx
  • src/data/presets.ts
  • src/index.css
  • src/main.tsx
  • src/utils/storage.ts
  • vite.config.ts

Comment thread index.html
Comment thread public/sw.js
Comment thread server.ts
Comment thread server.ts
Comment thread src/App.tsx
Comment thread src/App.tsx
Comment thread src/App.tsx
Comment thread src/index.css
Comment thread src/utils/storage.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e297a69a24

ℹ️ 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".

Comment thread public/manifest.webmanifest
@alwaysmeticulous

Copy link
Copy Markdown

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 e297a69. This comment will update as new commits are pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working codex documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed invalid This doesn't seem right question Further information is requested v0 wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant