Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSoC Ibus Extension Refactor #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jasisboredsojoinedgithub
Copy link

@jasisboredsojoinedgithub jasisboredsojoinedgithub commented Aug 19, 2024

GSoC Ibus Extension Refactor Final Report

This pull request includes a GSoC project Ibus Extension Refactor final report overview.

Project Goals

The primary goal of this project is to refactor the Customize IBus GNOME extension to ensure its compatibility with the latest GNOME versions release while enhancing its maintainability, extensibility, and user interface. The project aims to achieve the following:

  1. Migrate the Preferences Panel to libadwaita (Adw): Transition the extension's preference panel from vanilla GTK to libadwaita to align with the modern GNOME design guidelines. This will provide a more consistent and intuitive user interface .

  2. Refactor the Codebase for Maintainability and Extensibility: Improve the organization and modularity of the codebase by distributing the core functionalities across well-defined components within the lib and ui directories.

  3. Clean Up the Codebase and Remove Backward Compatibility: Remove deprecated code and eliminate support for older GNOME Shell versions.

  4. Improve the Input Source Indicator: Address issues with the input source indicator not following the cursor position in certain applications like Google Chrome.

What I Did

During the project, the following tasks were accomplished:

  1. Migrated the Preferences Panel: Successfully migrated the preferences panel from GTK to libadwaita, ensuring it adheres to modern GNOME UI standards. This involved replacing GTK widgets with their libadwaita counterparts, such as Adw.PreferencesWindow, Adw.SwitchRow, Adw.ComboRow, and others. Note, some child components were remain in Gtk and nested under the Adw components as there are no similar Adw counterparts.

  2. Refactored the Interface Codebase: The Prefs.js codebase was refactored for better maintainability by modularizing key components into separate files within the ui directories. Most values in Prefs.js file were rebinded to extension.js

  3. Cleaned Up Deprecated Code: Removed backward compatibility code and deprecated functions, aligning the extension with GNOME 45+ guidelines.

Current State

As some values are not finished keybinding yet, and some issues arised during local test, the project is not finished and requires further works and maintenences.

Remaining Work

Besides significant progress has been made, below is a list of what is left to do:

  1. Some values, e.g. the Gtk scales in genral and indicator page, Gtkbox in general page, need keybinding.
  2. Extension.js file needs further refactoring.
  3. Some bugs from local tests, and input source indicator issue need to be fixed.

Challenges and Lessons Learned

Throughout the project, I encountered several challenges. The first and most challenge was reading the existing codebase and restructuring the directories. As I was not familiar with these components initially, it took me a considerable amount of time to read the documentation and identify their modern counterparts. Once identified, I needed to integrate them and recode the interface accordingly.

The process of handling keybindings presented a similar challenge. Reading and understanding the backend code to bind the values in the UI files required a great deal of time and patience. Failing to bind values correctly was a common occurrence during this process. However, this experience greatly improved my ability to read and comprehend code. Once I successfully bound one type of value, the remaining tasks became much easier to accomplish.

Another significant challenge for me was time management. Balancing three different projects during the summer was not easy. However, this taught me the importance of effective time management and prioritization in handling multiple responsibilities simultaneously. Luckily my mentor @HollowMan6 is supportive and understanding. I want to express my gratitude for offering the opportunity to participate the project. The patience and willingness to help made a significant difference in my ability to overcome challenges and successfully complete the most part of the project.

Copy link
Member

@HollowMan6 HollowMan6 left a comment

Choose a reason for hiding this comment

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

Some formatting issues as something to start with the reviewing process.

In addition to these, the CI is failing for the formatting issues as well, https://github.com/openSUSE/Customize-IBus/actions/runs/10455429747/job/28954579307

I suggest you run the following commands first:

npm i
npm run pre-commit

Then manually fix the issue following npm run lint

[email protected]/schemas/gschemas.compiled Show resolved Hide resolved
[email protected]/lib/Manager.js Show resolved Hide resolved
},
"shell-version": [
"46"
],
"url": "https://github.com/openSUSE/Customize-IBus",
"uuid": "[email protected]",
"version": 89
Copy link
Member

Choose a reason for hiding this comment

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

You might want to bump the version when we finally want to release the project.

[email protected]/metadata.json Show resolved Hide resolved

prefs.fillPrefsWindow(window, UIFolderPath, gettextDomain);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Ditto (new line)

@@ -255,7 +255,7 @@
<summary>candidate popup box right click function</summary>
</key>
<key type="b" name="use-candidate-still">
<default>false</default>
<default>true</default>
Copy link
Member

Choose a reason for hiding this comment

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

Why change the default value here BTW?

@@ -10,7 +10,7 @@
<summary>use custom font</summary>
</key>
<key type="b" name="use-candidate-opacity">
<default>false</default>
<default>true</default>
Copy link
Member

Choose a reason for hiding this comment

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

Why change the default value here BTW?

</object>
</child>
</object>
</interface>
Copy link
Member

Choose a reason for hiding this comment

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

Ditto (New line)

[email protected]/ui/adw/indicator.ui Show resolved Hide resolved
[email protected]/ui/adw/tray.ui Show resolved Hide resolved
Copy link
Member

@HollowMan6 HollowMan6 left a comment

Choose a reason for hiding this comment

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

Additional issues to note:

Copy link
Member

@HollowMan6 HollowMan6 left a comment

Choose a reason for hiding this comment

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

By the way, is this PR actually a working version? If yes, then this is highly likely to be caused by the version upgrade. We must tackle this so that users who have already installed this plugin can have a smooth upgrade experience.
image

Currently, I'm waiting for this issue to be fixed before I can further review the PR.

@jasisboredsojoinedgithub
Copy link
Author

I'll review and fix those issue in this week.

@HollowMan6 HollowMan6 added the enhancement New feature or request label Sep 10, 2024
@HollowMan6 HollowMan6 linked an issue Sep 10, 2024 that may be closed by this pull request
@HollowMan6
Copy link
Member

As GNOME 47 has already entered into RC, I've released v90 to support it https://discourse.gnome.org/t/gnome-47-rc-released/23210. Then let's aim to have this for GNOME 48 instead, which will probably be February next year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GUI port to Adw (libadwaita) for GNOME 42
2 participants