🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)
⚠️ Malware / Trojaner / VirenVorsicht: Android-Malware verschlüsselt Ihre Handys und nimmt heimlich Fotos auf(11.09.2026 um 09:35 Uhr)
🕵️ SicherheitslückenMicrosoft geht endlich eines der nervigsten Probleme von Windows 11 an(11.09.2026 um 11:58 Uhr)
💾 IT Security ToolsSysinternals Suite(11.09.2026 um 12:00 Uhr)
🕵️ SicherheitslückenDefender 0-Day ShieldBreak (CVE-2026-69414) nicht sauber gepatcht - BornCity(11.09.2026 um 12:52 Uhr)
🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
⚠️ Malware / Trojaner / VirenWindows 11 just dropped the tool ransomware abused, Microsoft says don’t restore WMIC(10.09.2026 um 20:11 Uhr)
⚠️ Malware / Trojaner / VirenVorsicht: Android-Malware verschlüsselt Ihre Handys und nimmt heimlich Fotos auf(11.09.2026 um 09:35 Uhr)
🕵️ SicherheitslückenMicrosoft geht endlich eines der nervigsten Probleme von Windows 11 an(11.09.2026 um 11:58 Uhr)
💾 IT Security ToolsSysinternals Suite(11.09.2026 um 12:00 Uhr)
🕵️ SicherheitslückenDefender 0-Day ShieldBreak (CVE-2026-69414) nicht sauber gepatcht - BornCity(11.09.2026 um 12:52 Uhr)

🔧 Programmierung 🕛 vor 1 Jahr 9 Min Lesezeit
0

Stepping Out of My Comfort Zone: Refactoring Menus in ChatCraft

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Hi! My name is Harshil, and I am currently enrolled in an Open Source Development course at Seneca College. I had heard great reviews about this course, which is why I decided to enroll. During the lectures, I remember my professor repeatedly saying to "go out of your comfort zone" while contributing to open-source repositories. At the time, I didn’t give much thought to this advice.



Last month, I contributed to four open-source repositories, and I just realized that I did those contributions while staying in my comfort zone. I was working with technologies I was familiar with, tackling issues I knew how to resolve, and handling tasks that weren’t particularly challenging for me. While these contributions were valuable, I now understand that I wasn’t learning much by staying in my comfort zone.



This blog is about an issue I contributed to that pushed me out of my comfort zone. It was during this experience that I realized learning happens when you push yourself beyond what feels comfortable. Growth truly begins when you step outside your comfort zone.









Issue



This blog is about my contribution to ChatCraft.






GitHub logo



Developer-oriented ChatGPT clone







ChatCraft.org



Welcome to



Features



We think ChatCraft is the best platform for learning, experimenting, and getting creative with code. Here's a few of the reasons why we think you'll agree:


🛠️ You're in Control: Customize all aspects of a chat. Use your own System Prompts, edit, delete, and retry AI messages with models from competing vendors in the same chat.


🌍 Multiple AI Providers: ChatCraft supports both OpenAI and OpenRouter, giving you access to a…









posted on did some expert work to make the Ask menu more responsive and easier to use. We have a similar need in the Retry menu for AI Message responses. It would be interesting to see if we can re-use the same UX there, such that you can switch providers/models when retrying.









commented on


I just need to confirm one thing. I used a conditional in the component to render the MenuButton like this:



{menuButtonLabel &&
React.isValidElement(menuButtonLabel) &&
menuButtonLabel.type === SubMenu ? (
<MenuButton
as={Box}
fontSize="1rem"
fontWeight="normal"
cursor="pointer"
color="inherit"
padding="0"
background="none"
border="none"
aria-label={label || "Choose Model"}
title={label || "Choose Model"}
onClick={openOnHover ? undefined : onOpen} // Open on click if not openOnHover
onMouseEnter={openOnHover ? onOpen : undefined} // Open on hover if openOnHover
onMouseLeave={openOnHover ? onClose : undefined} // Close on hover out if openOnHover
>
{menuButtonLabel}
</MenuButton>
) : (
<MenuButton
as={IconButton}
size="sm"
fontSize="1.25rem"
aria-label={label || "Choose Model"}
title={label || "Choose Model"}
icon={<TbChevronUp />}
onClick={openOnHover ? undefined : onOpen} // Open on click if not openOnHover
onMouseEnter={openOnHover ? onOpen : undefined} // Open on hover if openOnHover
onMouseLeave={openOnHover ? onClose : undefined} // Close on hover out if openOnHover
borderLeftRadius="0"
/>
)}



The reason for this approach is that both use cases require MenuButton to function differently. Initially, I tried to keep this logic separate and only shared the menuItem logic, but it didn’t work. This is because the two places where this component needs to render use different menu libraries: one uses @chakra-ui/react components, and the other uses @szhsin/react-menu. That’s why I had to make the entire Menu component reusable.


What do you think?









posted on






I accepted the developer request and cloned the original repository. Initially, I was confused about how to transfer my changes from my forked repository’s branch to the original repository’s branch. Then I remembered I could set up my forked repository as a remote, fetch the branches, and merge the changes. I did that successfully and made another




posted on



This is Requested from #729



CODE
</div>
<div class="gh-btn-container"><a class="gh-btn" href="https://github.com/tarasglek/chatcraft.org/pull/730">View on GitHub</a></div>












It turned out that my ad-hoc approach was making the new component less reusable and introduced bugs. The maintainer suggested that the new component should use @szhsin/react-menu instead of @chakra-ui/react, and asked me to revisit the previous approach of extracting MenuList.



I started by making the required changes and created a new component called ModelSelectionMenuList, extracting the MenuList into this component. It worked as expected for the Retry menu, as its parent component was already using @szhsin/react-menu. However, it failed for the Ask menu, which was still using @chakra-ui/react components.



I reached out to the maintainer again, and they advised refactoring the Ask menu to also use @szhsin/react-menu components. Following their guidance, I successfully refactored the Ask menu to align with the new structure. This made the component consistent and reusable across both menus.









Mobile Screen Refactoring



While refactoring the Ask menu, I discovered that it was rendered differently for mobile and laptop screens. To address this, I updated my new component to handle both variations by using the same template logic to render different menus based on screen size. I also ensured that the Ask menu for mobile screens was refactored appropriately.









Final Thoughts



In total, I spent around two full days completing the PR for this issue. During the process, I had moments of doubt, feeling like I might not be able to finish it. However, I persevered and completed the task, gaining valuable knowledge in the process.



The most important lesson I learned from this issue—and from the Open Source Development course—is to challenge myself and step out of my comfort zone. Growth truly happens when we push our boundaries, and this experience reinforced that belief.


Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
2 Quellen
Microsoft bringt Emoji 17.0 auf Windows 11
1 Quelle
KI-Angriffe: Geheimdienste sollen neue Befugnisse erhalten
1 Quelle
Podcast: ChatGPT schwatzt Nutzern in Deutschland jetzt Werbung auf
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Stepping Out of My Comfort Zone: Refactoring Menus in ChatCraft

Thematisch verwandte Begriffe: Stepping, Comfort, Zone, Refactoring · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...