TerKix: rebrand UI, PWA & assets; enhance server Gemini API, workspace schema, and local storage utilities#16
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? |
📝 WalkthroughWalkthroughPR 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. ChangesChuyển đổi TerKix Terminal OS và Tích hợp PWA
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 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: 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".
There was a problem hiding this comment.
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
⛔ 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
There was a problem hiding this comment.
💡 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".
|
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 |
Motivation
Description
public/manifest.webmanifest,public/sw.js, andpublic/terkix-logo.svg, updateindex.html(meta, icons) and register the service worker insrc/main.tsx.server.tsaddGEMINI_MODELenv override,PORTsupport,/api/healthendpoint, input interfaces,normalizeFilesand robustparseGeminiJsonhelpers, switch AI model to useGEMINI_MODEL, update system instructions and response schema, and improve error handling/logging.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.src/utils/storage.tswithreadJsonStorage,readStringStorage,readNumberStorage, andwriteStorage, and migrate usages to safer helpers (renaming keys toterkix_*while honoring legacy keys where applicable).src/index.csswith TerKix-specific visual helpers, add a terminal-glass/grid background, and adjust responsive rules; addpublic/manifest.webmanifestand other assets for PWA behavior.package.jsonandpackage-lock.json(name →terkix-terminal-os, bump version, dev deps ordering) and add scripts (preview,typecheck) and description.Testing
npm run typecheck(aliastsc --noEmit); the codebase typechecks successfully.npm run buildto 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
terkix-terminal-os.GEMINI_MODELandPORT, add/api/health, structured request types, robust JSON parsing, and better error logging.read*/writeStoragehelpers; persist UI preferences and command history; migrate keys toterkix_*with legacy fallback.Migration
GEMINI_API_KEY; optionalGEMINI_MODELandPORT; updateAPP_URLif needed.terkix-shell-v2cache.Written for commit e297a69. Summary will update on new commits.