Skip to content

Fixes for new UI and headless mode#12

Merged
kis1yi merged 1 commit into
Silkroad-Developer-Community:mainfrom
kis1yi:ui-headless
May 30, 2026
Merged

Fixes for new UI and headless mode#12
kis1yi merged 1 commit into
Silkroad-Developer-Community:mainfrom
kis1yi:ui-headless

Conversation

@kis1yi
Copy link
Copy Markdown
Member

@kis1yi kis1yi commented May 30, 2026

  • conhost.exe process disabled for GUI mode
  • Fixed headless mode for rusro and jsro
  • Fixed tray icon size
  • Fixed splash screen size
  • Fixed main translation path

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved error handling and logging for client startup failures.
  • Style

    • Resized splash screen UI layout for improved visual presentation.
    • Refined console window behavior in GUI mode.
  • Chores

    • Updated localization file formatting.

Review Change Stack

- conhost.exe process disabled for GUI mode
- Fixed headless mode for rusro and jsro
- Fixed tray icon size
- Fixed splash screen size
- Fixed main translation path
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

📝 Walkthrough

Walkthrough

This PR updates console window handling for GUI mode by replacing Win32 interop calls with FreeConsole(), expands the splash screen layout from 533px to 640px width, refactors client startup to use async/await with error handling, and normalizes the Spanish localization file formatting.

Changes

OasisBot Application Improvements

Layer / File(s) Summary
Console window handling for GUI mode
Application/OasisBot/Program.cs
Replaces user32.dll P/Invoke (GetConsoleWindow/ShowWindow) with kernel32.dll FreeConsole() called before WinForms initialization (EnableVisualStyles, SetHighDpiMode, SplashScreen startup).
Splash screen UI layout resize to 640px width
Application/OasisBot/Views/SplashScreen.Designer.cs
Updates designer-generated sizes and positions for pictureBox, logoLabel, label2, label3, lblLoading, progressLoading, labelVersion, and form ClientSize to accommodate 640px-wide layout instead of 533px.
Client startup error handling with async/await
Plugins/RSBot.General/GeneralCLICommands.cs
Refactors StartClientCommand from ContinueWith continuation to async Task.Run with await and explicit try/catch, capturing exception messages directly on failure instead of fault/inner-exception handling.
Localization file line-ending normalization
Dependencies/Languages/OasisBot/es_ES.rsl
Normalizes formatting and line endings across all Spanish localization string definitions without altering semantic content or key-value pairs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A splash screen grows wider, pristine and bright,
Console windows vanish, no more in sight,
Async tasks now flow with error care,
Spanish strings reformatted with flair—
OasisBot's shell, made shiny and tight! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fixes for new UI and headless mode' is partially related to the changeset but lacks specificity and does not clearly capture the main changes made. Consider a more specific title that highlights the primary fix, such as 'Switch console handling from user32 to FreeConsole for GUI mode' or 'Improve UI layout and headless mode support'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@Dependencies/Languages/OasisBot/es_ES.rsl`:
- Line 43: Two localization entries remain in English; update the Spanish locale
by replacing the English text for NoBotbaseDetectedDesc and the other
untranslated entry at the same block (the string on line 52) with proper Spanish
translations. Locate the NoBotbaseDetectedDesc and the second untranslated key
in the es_ES resource file, provide idiomatic Spanish equivalents (including the
help URL), and ensure newline sequences (\n) are preserved exactly as in the
original string.
- Line 24: Update the Spanish confirmation label RSBot.ExitDialog.Panel.btnYes
to use the correct accented character: change its value from "Si" to "Sí"
(ensure the file is saved with UTF-8 encoding so the accent persists).

In `@Plugins/RSBot.General/GeneralCLICommands.cs`:
- Line 25: Replace the current Log.Error call that only logs ex.Message so the
full exception (including stack trace and inner exceptions) is logged; in
GeneralCLICommands.cs locate the Log.Error(...) line that references ex and
change it to pass the exception object into the logger (e.g. use the Log.Error
overload that accepts an Exception and a message) so the log contains both the
"Failed to start client" context and the full exception details.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3f1c9d52-42c9-4269-8612-89888782a640

📥 Commits

Reviewing files that changed from the base of the PR and between 5eb7768 and ab89ff7.

⛔ Files ignored due to path filters (3)
  • Application/OasisBot/Resources/tray.ico is excluded by !**/*.ico
  • Application/OasisBot/Resources/tray.png is excluded by !**/*.png
  • Application/OasisBot/tray.ico is excluded by !**/*.ico
📒 Files selected for processing (10)
  • Application/OasisBot/Program.cs
  • Application/OasisBot/Views/SplashScreen.Designer.cs
  • Dependencies/Languages/OasisBot/ar_AR.rsl
  • Dependencies/Languages/OasisBot/de_DE.rsl
  • Dependencies/Languages/OasisBot/en_US.rsl
  • Dependencies/Languages/OasisBot/es_ES.rsl
  • Dependencies/Languages/OasisBot/ru_RU.rsl
  • Dependencies/Languages/OasisBot/tr_TR.rsl
  • Dependencies/Languages/OasisBot/vn_VN.rsl
  • Plugins/RSBot.General/GeneralCLICommands.cs

RSBot.ScriptRecorder.Panel.btnClear="Limpiar"
RSBot.ScriptRecorder.Panel.btnStart="Grabar"
RSBot.ExitDialog.Panel.btnNo="No"
RSBot.ExitDialog.Panel.btnYes="Si"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix Spanish accent in confirmation label.

"Si" should be "Sí" in Spanish UI text.

Proposed fix
-RSBot.ExitDialog.Panel.btnYes="Si"
+RSBot.ExitDialog.Panel.btnYes="Sí"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RSBot.ExitDialog.Panel.btnYes="Si"
RSBot.ExitDialog.Panel.btnYes=""
🤖 Prompt for 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.

In `@Dependencies/Languages/OasisBot/es_ES.rsl` at line 24, Update the Spanish
confirmation label RSBot.ExitDialog.Panel.btnYes to use the correct accented
character: change its value from "Si" to "Sí" (ensure the file is saved with
UTF-8 encoding so the accent persists).

StartBot="Iniciar BOT"
StopBot="Detener BOT"
NoBotbaseDetected="¡No se ha detectado ninguna base de bots!"
NoBotbaseDetectedDesc="The bot can not be run without any botbase!\n Please install a proper botbase and try again.\n You can find help at https://silkroad-developer-community.github.io/OasisBot"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Translate remaining English strings in es_ES locale.

These two entries are still English, which breaks localization consistency in Spanish mode.

Proposed fix
-NoBotbaseDetectedDesc="The bot can not be run without any botbase!\n Please install a proper botbase and try again.\n You can find help at https://silkroad-developer-community.github.io/OasisBot"
+NoBotbaseDetectedDesc="¡El bot no puede ejecutarse sin una base de bots!\nPor favor, instala una base de bots adecuada e inténtalo de nuevo.\nPuedes encontrar ayuda en https://silkroad-developer-community.github.io/OasisBot"

-ConfigureTrainingAreaBeforeStartBot="Please configure the training area before start the bot!"
+ConfigureTrainingAreaBeforeStartBot="¡Por favor, configura el área de entrenamiento antes de iniciar el bot!"

Also applies to: 52-52

🤖 Prompt for 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.

In `@Dependencies/Languages/OasisBot/es_ES.rsl` at line 43, Two localization
entries remain in English; update the Spanish locale by replacing the English
text for NoBotbaseDetectedDesc and the other untranslated entry at the same
block (the string on line 52) with proper Spanish translations. Locate the
NoBotbaseDetectedDesc and the second untranslated key in the es_ES resource
file, provide idiomatic Spanish equivalents (including the help URL), and ensure
newline sequences (\n) are preserved exactly as in the original string.

}
catch (Exception ex)
{
Log.Error($"Failed to start client: {ex.Message}");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Log the full exception for better debuggability.

Logging only ex.Message loses the stack trace and any inner exceptions, making debugging failures more difficult. Consider logging the full exception object.

📝 Proposed fix to log the full exception
-                Log.Error($"Failed to start client: {ex.Message}");
+                Log.Error($"Failed to start client: {ex}");

Alternatively, if you want to keep the prefix message:

-                Log.Error($"Failed to start client: {ex.Message}");
+                Log.Error(ex);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Log.Error($"Failed to start client: {ex.Message}");
Log.Error($"Failed to start client: {ex}");
🤖 Prompt for 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.

In `@Plugins/RSBot.General/GeneralCLICommands.cs` at line 25, Replace the current
Log.Error call that only logs ex.Message so the full exception (including stack
trace and inner exceptions) is logged; in GeneralCLICommands.cs locate the
Log.Error(...) line that references ex and change it to pass the exception
object into the logger (e.g. use the Log.Error overload that accepts an
Exception and a message) so the log contains both the "Failed to start client"
context and the full exception details.

@kis1yi kis1yi merged commit 32c2fc0 into Silkroad-Developer-Community:main May 30, 2026
1 of 2 checks passed
@kis1yi kis1yi deleted the ui-headless branch May 30, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant