Skip to content

Feature/dependency update#35

Merged
META-Xiao merged 7 commits into
mainfrom
feature/dependency-update
Mar 13, 2026
Merged

Feature/dependency update#35
META-Xiao merged 7 commits into
mainfrom
feature/dependency-update

Conversation

@META-Xiao

Copy link
Copy Markdown
Owner

The dependencies were updated, and some issues arising after the update were resolved.


Root Cause

  • sora-editor's TextMateAnalyzer.tokenizeLine() always creates spans with SpanFactory.obtainNoExt()
  • NoExtSpanImpl does not support setUnderlineColor() method
  • When theme contains underline style, it attempts to call this unsupported method

Temporary Solution

Removed all "fontStyle": "underline" settings from theme JSON files (dark.json and light.json) to prevent the crash.

Permanent Solution

Waiting for sora-editor to release a new version with the underline support fix (PR already merged in their repository). Once released, re-enable underline styles in theme files.

Files Changed

  • app/src/main/assets/textmate/themes/dark.json - Removed underline fontStyle
  • app/src/main/assets/textmate/themes/light.json - Removed underline fontStyle
  • Added TODO comments in both theme files for future updates

TODO

  • Update sora-editor dependency when new version is released
  • Re-enable "fontStyle": "underline" in theme JSON files

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

UI Insets Handling

The PR introduces a new strategy for handling system window insets and the soft keyboard. Verify that the UI correctly adjusts to the status bar, navigation bar, and IME (keyboard) appearance/disappearance without visual glitches or unexpected layout shifts across different device sizes and orientations.

// Enable system window insets handling
androidx.core.view.WindowCompat.setDecorFitsSystemWindows(window, true)

// Set up toolbar
val toolbar = findViewById<androidx.appcompat.widget.Toolbar>(R.id.toolbar)
setSupportActionBar(toolbar)

// Handle IME insets for content frame
val contentFrame = findViewById<android.widget.FrameLayout>(R.id.content_frame)
androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(contentFrame) { v, insets ->
    val imeHeight = insets.getInsets(androidx.core.view.WindowInsetsCompat.Type.ime()).bottom
    v.setPadding(0, 0, 0, imeHeight)
    insets
}
Layout Regression

The height of symbol buttons has been changed from WRAP_CONTENT to MATCH_PARENT and minHeight was removed. Visually inspect the symbol panel to ensure buttons maintain correct sizing, spacing, and alignment within their parent layout.

layoutParams = LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1f).apply {
    setMargins(2, 2, 2, 2)
Toolbar Styling

The toolbar's height is now hardcoded to 48dp and contentInsetStart/contentInsetEnd are set to 0dp. Verify that the toolbar's appearance, including title and navigation icons, is consistent and visually appealing across various devices and locales, and that it doesn't conflict with system UI elements.

android:layout_height="48dp"
android:background="@color/title_background"
android:elevation="4dp"
app:titleTextColor="@color/onPrimaryContainer_light"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:contentInsetStart="0dp"
android:contentInsetEnd="0dp" />

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Consume IME insets after handling

After applying padding to handle the IME insets, the setOnApplyWindowInsetsListener
should return a WindowInsetsCompat object that reflects this consumption. Returning
the original insets can lead to child views incorrectly reacting to the same IME
insets, causing layout issues. Create a new WindowInsetsCompat with the IME type
zeroed out to prevent double application.

app/src/main/java/com/acc_ide/ui/main/MainActivity.kt [103-105]

 ...
             val imeHeight = insets.getInsets(androidx.core.view.WindowInsetsCompat.Type.ime()).bottom
             v.setPadding(0, 0, 0, imeHeight)
-            insets
+            // Consume the IME insets so they are not passed down to children
+            androidx.core.view.WindowInsetsCompat.Builder(insets)
+                .setInsets(androidx.core.view.WindowInsetsCompat.Type.ime(), android.graphics.Insets.NONE)
+                .build()
         }
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a potential issue where IME insets might be double-applied if not consumed, which can lead to layout problems. Returning a modified WindowInsetsCompat object is the correct approach to prevent this.

Medium
General
Use dimension resource for toolbar height

Hardcoding android:layout_height="48dp" for the toolbar can lead to inconsistencies
with standard Android UI guidelines and make future design changes more difficult.
It is generally better to use a dimension resource (e.g., @dimen/toolbar_height) or
a theme attribute like ?attr/actionBarSize for standard components. Define the
height in dimens.xml for better maintainability.

app/src/main/res/layout/activity_main.xml [18-22]

 ...
         android:id="@+id/toolbar"
         android:layout_width="match_parent"
-        android:layout_height="48dp"
+        android:layout_height="@dimen/toolbar_height"
         android:background="@color/title_background"
         android:elevation="4dp"
 ...
Suggestion importance[1-10]: 6

__

Why: Hardcoding dimensions like 48dp for UI elements is generally discouraged in Android development. Using a dimension resource or a theme attribute improves maintainability and consistency across different screen sizes and densities.

Low

@META-Xiao

META-Xiao commented Mar 13, 2026

Copy link
Copy Markdown
Owner Author

NOTE: i should release this version as a pre-release (if i wanna pulish)

@META-Xiao META-Xiao merged commit 0967022 into main Mar 13, 2026
1 check passed
@META-Xiao META-Xiao deleted the feature/dependency-update branch March 13, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant