Google Summer of Code Final Work Product#
Name: Praneeth Shetty
Organisation: Python Software Foundation
Sub-Organisation: FURY
Project: FURY - Update user interface widget + Explore new UI Framework
Proposed Objectives#
SpinBoxUI
Scrollbar as Independent Element
FileDialog
TreeUI
AccordionUI
ColorPickerUI
- Stretch Goals:
Exploring new UI Framework
Implementing Borders for UI elements
Objectives Completed#
- SpinBoxUI:
The
SpinBoxUI
element is essential for user interfaces as it allows users to pick a numeric value from a set range. While we had an active pull request (PR) to add this element, updates in the main code caused conflicts and required further changes for added features. At one point, we noticed that text alignment wasn’t centered properly within the box due to a flaw. To fix this, we began a PR to adjust the alignment, but it turned into a larger refactoring of theTextBlock2D
, a core component connected to various parts. This was a complex task that needed careful handling. After sorting out theTextBlock2D
, we returned to theSpinBoxUI
and made a few tweaks. Once we were confident with the changes, the PR was successfully merged after thorough review and testing.Pull Requests:
SpinBoxUI (Merged) - fury-gl/fury#499
- `TextBlock2D` Refactoring:
This was a significant aspect of the GSoC period and occupied a substantial portion of the timeline. The process began when we observed misaligned text in the
SpinBoxUI
, as previously discussed. The root cause of the alignment issue was the mispositioning of the text actor concerning the background actor. The text actor’s independent repositioning based on justification conflicted with the static position of the background actor, leading to the alignment problem.To address this, the initial focus was on resolving the justification issue. However, as the work progressed, we recognized that solely adjusting justification would not suffice. The alignment was inherently linked to the UI’s size, which was currently retrieved only when a valid scene was present. This approach lacked scalability and efficiency, as it constrained size retrieval to scene availability.
To overcome these challenges, we devised a solution involving the creation of a bounding box around the
TextBlock2D
. This bounding box would encapsulate the size information, enabling proper text alignment. This endeavor spanned several weeks of development, culminating in a finalized solution that underwent rigorous testing before being merged.As a result of this refactoring effort, the
TextBlock2D
now offers three distinct modes:Fully Static Background: This mode requires background setup during initialization.
Dynamic Background: The background dynamically scales based on the text content.
Auto Font Scale Mode: The font within the background box automatically scales to fill the available space.
An issue has been identified with
TextBlock2D
where its text actor aligns with the top boundary of the background actor, especially noticeable with letters like “g,” “y,” and “j”. These letters extend beyond the baseline of standard alphabets, causing the text box to shift upwards.However, resolving this matter is complex. Adjusting the text’s position might lead to it touching the bottom boundary, especially in font scale mode, resulting in unexpected positioning and transformations. To address this, the plan is to defer discussions about this matter until after GSoC, allowing for thorough consideration and solutions.
For more detailed insights into the individual steps and nuances of this process, you can refer to the comprehensive weekly blog post provided below. It delves into the entire journey of this
TextBlock2D
refactoring effort.Pull Requests:
Fixing Justification Issue - 1st Draft (Closed) - fury-gl/fury#790
Adding BoundingBox and fixing Justificaiton (Merged) - fury-gl/fury#803
Adding getters and setter for properties (Merged) - fury-gl/fury#830
Text Offset PR (Closed) - fury-gl/fury#837
- ScrollbarUI as Independent Element:
We initially planned to make the scrollbar independent based on PR #16. The main goal was to avoid redundancy by not rewriting the scrollbar code for each element that requires it, such as the
FileMenu2D
. However, upon further analysis, we realized that elements like theFileMenu2D
and others utilize theListbox2D
, which already includes an integrated scrollbar. We also examined other UI libraries and found that they also have independent scrollbars but lack a proper use case. Typically, display containers likeListbox2D
are directly used instead of utilizing an independent scrollbar.Based on these findings, we have decided to close all related issues and pull requests for now. If the need arises in the future, we can revisit this topic.
Topic: - fury-gl/fury#816
Other Objectives#
- Reviewing & Merging:
In this phase, my focus was not on specific coding but rather on facilitating the completion of ongoing PRs. Here are two instances where I played a role:
CardUI PR: I assisted with the
CardUI
PR by aiding in the rebase process and reviewing the changes. The CardUI is a simple UI element consisting of an image and a description, designed to function like a flash card. I worked closely with my mentor to ensure a smooth rebase and review process.ComboBox Issue: There was an issue with the
ComboBox2D
functionality, where adding it to aTabUI
caused all elements to open simultaneously, which shouldn’t be the case. I tested various PRs addressing this problem and identified a suitable solution. I then helped the lead in reviewing the PR that fixed the issue, which was successfully merged.
Pull Requests:
CardUI (Merged) - fury-gl/fury#398
ComboBox Flaw (Merged) - fury-gl/fury#768
Updating Broken Website Links:
I addressed an issue with malfunctioning links in the Scientific Section of the website. The problem emerged from alterations introduced in PR #769. These changes consolidated demos and examples into a unified “auto_examples” folder, and a toml file was utilized to retrieve this data and construct examples. However, this led to challenges with the paths employed in website generation. My responsibility was to rectify these links, ensuring they accurately direct users to the intended content.
Pull Requests:
Updating Broken Links (Merged) - fury-gl/fury#820
Objectives in Progress#
FileDialogUI:
An existing
FileDialog
PR by Soham (#294) was worked upon. The primary task was to rebase the PR to match the current UI structure, resolving compatibility concerns with the older base. In PR #832, we detailed issues encompassing resizingFileDialog
and components, addressing text overflow, fixingZeroDivisionError
, and correctingListBox2D
item positioning. The PR is complete with comprehensive testing and documentation. Presently, it’s undergoing review, and upon approval, it will be prepared for integration.Pull Requests:
Soham’s FileDialog (Closed) - fury-gl/fury#294
FileDialogUI (Under Review) - fury-gl/fury#832
TreeUI:
Continuing Antriksh’s initial PR for
TreeUI
posed some challenges. Antriksh had set the foundation, and I picked up from there. The main issue was with the visibility of TreeUI due to updates in theset_visibility
method ofPanel2D
. These updates affected howTreeUI
was displayed, and after investigating the actors involved, it was clear that the visibility features had changed. This took some time to figure out, and I had a helpful pair programming session with my mentor, Serge, to narrow down the problem. Now, I’ve updated the code to address this issue. However, I’m still a bit cautious about potential future problems. The PR is now ready for review.Pull Requests:
TreeUI (In Progress) - fury-gl/fury#821
GSoC Weekly Blogs#
My blog posts can be found at FURY website and Python GSoC blog.
Timeline#
Date |
Description |
Blog Post Link |
|
---|---|---|---|
Week 0 (27-05-2023) |
Community Bounding Period |
||
Week 1 (03-06-2023) |
Working with SpinBox and TextBox Enhancements |
||
Week 2 (10-06-2023) |
Tackling Text Justification and Icon Flaw Issues |
||
Week 3 (17-06-2023) |
Resolving Combobox Icon Flaw and TextBox Justification |
||
Week 4 (24-06-2023) |
Exam Preparations and Reviewing |
||
Week 5 (01-07-2023) |
Trying out PRs and Planning Ahead |
||
Week 6 (08-07-2023) |
BoundingBox for TextBlock2D! |
||
Week 7 (15-07-2023) |
Sowing the seeds for TreeUI |
||
Week 8 (22-07-2023) |
Another week with TextBlockUI |
||
Week 9 (29-07-2023) |
TextBlock2D is Finally Merged! |
||
Week 10 (05-08-2023) |
Its time for a Spin-Box! |
||
Week 11 (12-08-2023) |
Bye Bye SpinBox |
||
Week 12 (19-08-2023) |
FileDialog Quest Begins! |