<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Fyodor</title>
    <description>The latest articles on DEV Community by Fyodor (@kroxut).</description>
    <link>https://dev.to/kroxut</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4023932%2F23bb9341-ba1c-4954-9262-0479ad477c7e.jpg</url>
      <title>DEV Community: Fyodor</title>
      <link>https://dev.to/kroxut</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kroxut"/>
    <language>en</language>
    <item>
      <title>A 10-Minute CAD Task Took 3 Hours With GPT-6. Here's What Went Wrong</title>
      <dc:creator>Fyodor</dc:creator>
      <pubDate>Sat, 28 Nov 2026 10:09:12 +0000</pubDate>
      <link>https://dev.to/kroxut/a-10-minute-cad-task-took-3-hours-with-gpt-6-heres-what-went-wrong-5djn</link>
      <guid>https://dev.to/kroxut/a-10-minute-cad-task-took-3-hours-with-gpt-6-heres-what-went-wrong-5djn</guid>
      <description>&lt;p&gt;I needed a small 3D-printed spacer to mount an Arctic P12 PWM PST fan on my be quiet! Dark Rock Pro 4 CPU cooler. Normally, I would open Tinkercad or another CAD editor, take a few measurements with calipers, and model the part in about &lt;strong&gt;5–10 minutes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead, I decided to run an experiment: could ChatGPT, running GPT-6, design the same part from a natural-language description and manufacturer documentation?&lt;/p&gt;

&lt;p&gt;The answer was yes — eventually. &lt;strong&gt;We got a working part, but it took approximately three hours of active interaction with AI.&lt;/strong&gt; Most of that time wasn't spent modeling anything. It was spent trying to make the AI understand what I actually wanted.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Task: A Simple Fan Spacer
&lt;/h2&gt;

&lt;p&gt;My CPU cooler is a &lt;a href="https://www.bequiet.com/en/cpucooler/1378" rel="noopener noreferrer"&gt;be quiet! Dark Rock Pro 4 (BK022)&lt;/a&gt;. I wanted to replace its original fan with an &lt;a href="https://www.arctic.de/en/P12-PWM-PST/P12-PWM-PST-EOL" rel="noopener noreferrer"&gt;Arctic P12 PWM PST&lt;/a&gt;, but there was one small mechanical problem. The original fan's wire mounting clips attach closer to the middle of its frame thickness. The Arctic P12 has mounting holes on the outer faces of its frame, so the original clips couldn't secure it properly.&lt;/p&gt;

&lt;p&gt;My solution was straightforward: make small plastic spacers that fit inside the Arctic P12 mounting corners. The spacers would slide over the existing internal reinforcement ribs and be secured from underneath with the original fan screws. This would allow the original be quiet! wire clips to be reused without modification. Geometrically, this is an extremely simple part: a flat profile with a screw hole and a slot, extruded to the required height. No complex surfaces, assemblies, moving parts, or advanced mechanical calculations.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the Requirements Evolved
&lt;/h2&gt;

&lt;p&gt;My initial request described the mounting problem, proposed the internal spacer solution, and asked ChatGPT to find the technical documentation for both fans. I also suggested starting with a 2D drawing, as I would normally do when modeling a part like this. &lt;/p&gt;

&lt;p&gt;To its credit, ChatGPT successfully found the manufacturer's documentation, including the &lt;a href="https://support.arctic.de/products/p12-pwm-pst/techdocs/P12%20Series%20-%202D%20Drawing.pdf" rel="noopener noreferrer"&gt;official Arctic P12 dimensional drawing&lt;/a&gt;. The drawing provided the main dimensions, frame thickness, mounting hole diameter, and hole spacing. However, some important details were missing, particularly the dimensions of the internal reinforcement rib.&lt;/p&gt;

&lt;p&gt;Instead of identifying those unknowns and asking me to measure them, ChatGPT started proposing designs. And that's where things went wrong. After several incorrect attempts, I found a photograph of the Arctic mounting corner in a review, marked the area where the spacer should go, and sent it to ChatGPT. When that didn't help, I drew a rough sketch in Microsoft Paint. Later, I had to clarify the slot geometry and measure the reinforcement rib thickness myself: &lt;strong&gt;2.3 mm&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9hzr1mo3aygsdzgl51en.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9hzr1mo3aygsdzgl51en.png" alt="Figure 1 — How the requirements evolved" width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Figure 1 — How the requirements evolved&lt;/strong&gt;. &lt;em&gt;A — The mounting corner with the intended location marked; B — my first rough Paint sketch; C — a more detailed sketch of the required spacer.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;These images weren't all part of the original request. I provided them progressively to correct the AI's misunderstandings. What should have been a normal process of refining a technical specification gradually turned into repeated attempts to explain a solution I had already proposed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure #1: Solving the Wrong Problem
&lt;/h2&gt;

&lt;p&gt;Initially, ChatGPT focused on the difference between the fans' overall dimensions. It proposed external adapters, complicated brackets, additional hooks, and other structures that had little to do with my intended solution. I repeatedly explained that the spacer belonged &lt;strong&gt;inside the existing mounting corner&lt;/strong&gt;, where the reinforcement rib could be used to position it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw92qhef0dr6ore6f2gyh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw92qhef0dr6ore6f2gyh.png" alt="Figure 2 — Some of GPT-6's unsuccessful designs" width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Figure 2 — Some of GPT-6's unsuccessful designs&lt;/strong&gt; - &lt;em&gt;A, B, C — Actual incorrect designs produced during the conversation.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Another issue appeared when ChatGPT started using the photograph. Because the mounting corner was photographed at an angle, the AI treated perspective distortion as if it represented the actual geometry. My hand-drawn sketch and the manufacturer's dimensional drawing should have been more important sources for the shape and coordinates.&lt;/p&gt;

&lt;p&gt;At one point, I had to tell it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Stop looking at the screenshot. Look at the documentation! You already have the drawings!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Even then, mistakes continued. For example, the slot intended to fit over the reinforcement rib was positioned incorrectly relative to the screw hole. What made this especially frustrating was that ChatGPT repeatedly assured me that it finally understood the task, while the next drawing sometimes proved otherwise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure #2: Not Asking the Right Questions
&lt;/h2&gt;

&lt;p&gt;This was probably the most interesting part of the experiment. ChatGPT had successfully retrieved the technical documentation, but it didn't consistently distinguish between &lt;strong&gt;known dimensions and missing information&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It could have asked for the rib thickness, the available space inside the corner, or the distance needed to position the wire clip correctly. Alternatively, it could have created a parametric sketch with clearly marked unknown dimensions, allowing me to provide the missing measurements before proceeding.&lt;/p&gt;

&lt;p&gt;Instead, it kept generating complete-looking solutions based partly on assumptions. When I corrected a mistake, it often modified the previous incorrect design rather than reconsidering the original requirements.&lt;/p&gt;

&lt;p&gt;This is a familiar problem in AI-assisted software development, too: an AI can confidently implement a solution that doesn't actually satisfy the requirements. The output may look convincing, the code may run, or the model may be technically valid, yet the original problem remains unsolved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Failure #3: Generating Images Instead of CAD Geometry
&lt;/h2&gt;

&lt;p&gt;At first, ChatGPT produced impressive-looking technical illustrations. They included dimensions, arrows, cross-sections, and 3D views. Some looked like professional engineering documentation, but unfortunately, looking technical isn't the same as being geometrically correct.&lt;/p&gt;

&lt;p&gt;Dimensions could contradict each other, holes and slots weren't always aligned, and some parts contained features I had never requested. The images were visually plausible but couldn't be treated as reliable engineering drawings.&lt;/p&gt;

&lt;p&gt;Real progress began only when we stopped relying on AI-generated illustrations and moved to actual vector geometry and a parametric 3D model.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxexzoozlghfrba1118ap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxexzoozlghfrba1118ap.png" alt="Figure 3 — Evolution of the spacer geometry" width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Figure 3 — Evolution of the spacer geometry&lt;/strong&gt; - &lt;em&gt;A — Incorrect slot alignment; B — corrected geometry; C — the expanded final profile.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The model was eventually generated using programmatic geometry and exported as STL, with OpenSCAD and SVG source files. But even after switching to actual CAD geometry, one major dimension was still wrong.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Did GPT-6 Choose 7.5 mm?
&lt;/h3&gt;

&lt;p&gt;ChatGPT suggested a spacer height of 7.5 mm. Its calculation was based on the Arctic P12 frame thickness: 25 mm overall, minus two outer mounting sections of 5 mm each, leaving a 15 mm internal gap. It then divided that gap in half.&lt;/p&gt;

&lt;p&gt;The arithmetic was correct. &lt;strong&gt;The engineering reasoning was not.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Half the internal gap of the Arctic fan doesn't determine where the original be quiet! mounting clip needs to attach. The calculation produced a geometrically valid distance, but not the dimension required by the actual mechanical design.&lt;/p&gt;

&lt;p&gt;My physical measurements showed that the required spacer height was &lt;strong&gt;11 mm&lt;/strong&gt;, and that's the value I used for printing.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;
  GPT-6's explanation of the height error
  &lt;p&gt;&lt;em&gt;This explanation was generated by GPT-6 after the experiment.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I calculated a geometrically valid distance, but it wasn't the dimension required by the functional specification. I should have determined the distance from the spacer's supporting surface to the correct mounting position of the wire clip.&lt;/p&gt;

&lt;p&gt;Instead, I used half the Arctic fan's internal frame gap. The problem wasn't arithmetic; it was choosing the wrong reference geometry.&lt;/p&gt;

&lt;p&gt;The correct 11 mm dimension was established through the user's measurements and confirmed by physical installation.&lt;/p&gt;



&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Second Iteration: A Working Part
&lt;/h2&gt;

&lt;p&gt;After correcting the geometry and expanding the spacer's contact area, I prepared the second design iteration and printed the parts. This time, everything fitted. The spacers seated over the internal reinforcement ribs, were secured with the original fan screws, and allowed the original be quiet! wire clips to hold the Arctic P12.&lt;/p&gt;

&lt;p&gt;There was still one small imperfection: the outer corner radius of the printed spacer didn't quite match the fan frame. As a result, the spacer protrudes approximately &lt;strong&gt;1–2 mm&lt;/strong&gt; beyond the outer contour. It doesn't affect the mounting, so I decided not to redesign it again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9slhxke9e4ejm2kygehp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9slhxke9e4ejm2kygehp.jpg" alt="Figure 4 — The actual printed spacer installed in my PC" width="800" height="942"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Figure 4 — The actual printed spacer installed in my PC&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The real printed part, secured inside the Arctic P12 mounting corner and used with the original be quiet! wire clip.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I published the design and source files on Thingiverse:&lt;br&gt;
&lt;strong&gt;&lt;a href="https://www.thingiverse.com/thing:7440472/" rel="noopener noreferrer"&gt;Arctic P12 Fan Mount Spacer for Dark Rock Pro 4 — Thingiverse&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One important note for anyone who wants to print it: the published STL retains its original height of 7.5 mm. For my installation, I scaled only the Z dimension to &lt;strong&gt;11 mm&lt;/strong&gt;, leaving X and Y unchanged.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Result: Three Hours Instead of Ten Minutes
&lt;/h2&gt;

&lt;p&gt;The whole experiment took approximately &lt;strong&gt;three hours of active interaction with ChatGPT&lt;/strong&gt;, excluding 3D printing and physical test fitting. My estimate for modeling the same part manually in a familiar CAD editor is 5–10 minutes, including caliper measurements.&lt;/p&gt;

&lt;p&gt;That manual estimate isn't a separately timed benchmark. It's based on my experience with similar simple CAD tasks. Still, the difference was substantial.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What I evaluated&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Generating a printable 3D model&lt;/td&gt;
&lt;td&gt;Successful&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Understanding the initial requirements&lt;/td&gt;
&lt;td&gt;Multiple failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Using manufacturer documentation&lt;/td&gt;
&lt;td&gt;Partially successful&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Identifying missing dimensions&lt;/td&gt;
&lt;td&gt;Poor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Following geometric constraints&lt;/td&gt;
&lt;td&gt;Required repeated corrections&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Human supervision&lt;/td&gt;
&lt;td&gt;Extensive&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Saving time&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Physical installation&lt;/td&gt;
&lt;td&gt;Successful&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;And remember: this was an extremely simple part, essentially one 2D profile, a hole, a slot, and an extrusion. What would happen with a more complex mechanical component involving multiple mating surfaces, tight tolerances, assemblies, and structural requirements?&lt;/p&gt;

&lt;p&gt;This experiment can't answer that question. But it certainly made me more cautious about trusting AI-generated engineering results without independent verification.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The biggest problem wasn't creating the geometry. It was getting the AI to consistently understand and follow an already proposed design.&lt;/strong&gt; There is a significant difference between being able to produce an STL file and being able to solve an engineering problem efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Could a Proper CAD Agent Do Better?
&lt;/h2&gt;

&lt;p&gt;This experiment was performed in &lt;strong&gt;November 2026 using GPT-6 in the regular ChatGPT conversation interface&lt;/strong&gt;. I started without a dedicated CAD agent. During the experiment, after several unsuccessful attempts, I switched to the High reasoning mode, but that didn't eliminate the problems.&lt;/p&gt;

&lt;p&gt;I didn't test Claude, Gemini, Grok, or any dedicated CAD agents under the same conditions. However, several interesting alternatives have emerged, including SolidCraft with MCP and AI-assisted workflows in FreeCAD.&lt;/p&gt;

&lt;p&gt;Another user reported recreating a similar spacer using Gemini in roughly 15 minutes. However, since the original design and its dimensions are already publicly available, it's difficult to determine whether the model independently solved the problem or benefited from existing information.&lt;/p&gt;

&lt;p&gt;These suggestions raise an interesting question: &lt;strong&gt;would giving an AI direct access to a CAD editor improve its understanding of engineering requirements, or simply help it build the wrong geometry faster?&lt;/strong&gt; That's something I'd like to explore in future experiments.&lt;/p&gt;

&lt;p&gt;If you want to reproduce this case with another model or CAD agent, feel free to do so. For a meaningful comparison, start with the original problem rather than giving the AI the final geometry and corrected dimensions. The &lt;a href="https://www.thingiverse.com/thing:7440472/" rel="noopener noreferrer"&gt;published model and source files&lt;/a&gt; can also be studied, modified, and reused under the project's license.&lt;/p&gt;

&lt;p&gt;I'd be interested to hear which model and tools you used, how many corrections were needed, how much active human time the task required, and whether the resulting part was actually usable. &lt;strong&gt;Share your results in the comments — or write your own article.&lt;/strong&gt; Successful attempts and failures are equally interesting.&lt;/p&gt;

&lt;p&gt;The important question is no longer whether an AI can generate a 3D model. It can. &lt;strong&gt;The question is whether it can reliably turn an incomplete engineering request into a correct, editable, physically usable part — without turning a ten-minute job into a three-hour debugging session.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cad</category>
      <category>3dprinting</category>
      <category>productivity</category>
    </item>
    <item>
      <title>I Needed Collapsible App Groups in Django Admin, So I Built a Package</title>
      <dc:creator>Fyodor</dc:creator>
      <pubDate>Fri, 10 Jul 2026 12:59:01 +0000</pubDate>
      <link>https://dev.to/kroxut/i-needed-collapsible-app-groups-in-django-admin-so-i-built-a-package-45nm</link>
      <guid>https://dev.to/kroxut/i-needed-collapsible-app-groups-in-django-admin-so-i-built-a-package-45nm</guid>
      <description>&lt;p&gt;The built-in Django Admin works well, especially while a project is still small. But as a project grows, the sidebar gradually fills up with more applications and models: users, permissions, products, orders, reports, integrations, internal reference data, and many other sections.&lt;/p&gt;

&lt;p&gt;Most of these sections are not used all the time. In one project, an administrator may spend most of the day working with orders and customers, while dozens of rarely used models remain visible in the sidebar.&lt;/p&gt;

&lt;p&gt;At some point, I wanted to add a very simple feature to the standard Django Admin sidebar: click an arrow next to an application name and collapse its list of models.&lt;/p&gt;

&lt;p&gt;It seemed like a small interface improvement. However, I could not find a lightweight package that added exactly this behavior to the standard Django Admin without replacing it with a custom theme.&lt;/p&gt;

&lt;p&gt;So I built django-admin-collapse-apps.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What the package does&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The package adds a toggle next to every application group heading. When the toggle is clicked, the model list is hidden and only the application name remains visible.&lt;/p&gt;

&lt;p&gt;The selected state is stored in a cookie. After refreshing the page or returning to the admin later, previously collapsed groups remain collapsed. When the user expands all application groups again, the cookie is removed.&lt;/p&gt;

&lt;p&gt;The package does not replace Django’s standard navigation, change the order of applications or models, or interfere with permission checks. It only adds collapsible behavior to the application groups already generated by Django.&lt;/p&gt;

&lt;p&gt;This is what the sidebar looks like before collapsing groups:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy4h3k2hpx70vzu93fr0b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy4h3k2hpx70vzu93fr0b.png" alt="Application groups in their default expanded state." width="552" height="1618"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this is what it looks like after:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff0uwlw0ckxpuf8rkik4p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff0uwlw0ckxpuf8rkik4p.jpg" alt="Collapsed application groups in the standard Django Admin sidebar." width="552" height="1076"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The package is available on PyPI and can be installed with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m pip install django-admin-collapse-apps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation, add it to INSTALLED_APPS before django.contrib.admin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="no"&gt;INSTALLED_APPS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"django_admin_collapse_apps"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"django.contrib.admin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;# Other project applications&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is all that is required for the basic setup. After restarting the project, collapse toggles will appear next to all application groups in the standard Django Admin sidebar.&lt;/p&gt;

&lt;p&gt;The position before django.contrib.admin is important because the package adds its own templates and static files on top of the standard admin templates.&lt;/p&gt;

&lt;p&gt;Restricting collapse toggles to selected applications&lt;/p&gt;

&lt;p&gt;By default, toggles are added to every application group. For most projects, this is the simplest behavior because each user can decide which sections should remain visible.&lt;/p&gt;

&lt;p&gt;In some cases, however, part of the menu should always stay expanded. For example, you may want to allow collapsing only for rarely used internal applications.&lt;/p&gt;

&lt;p&gt;To do this, add a list of Django app labels to the project settings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="no"&gt;ADMIN_COLLAPSE_APPS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"auth"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"reports"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"integrations"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, toggles will only appear for the listed applications. All other groups will continue to behave like regular Django Admin navigation items.&lt;/p&gt;

&lt;p&gt;These values are Django app labels, not application display names. In most projects, the label matches the application name, but in more complex configurations it is better to check the application’s AppConfig.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why cookies instead of localStorage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At first, localStorage seemed like the obvious choice for storing the collapsed state. This is a purely client-side feature, so using browser storage would have been reasonable.&lt;/p&gt;

&lt;p&gt;However, cookies have one practical advantage here: they can be scoped to a particular admin path and separated between multiple administrative interfaces hosted on the same domain.&lt;/p&gt;

&lt;p&gt;The cookie stores only the app labels of collapsed applications. It does not contain user data, model content, or any other information from the admin interface.&lt;/p&gt;

&lt;p&gt;A simplified value looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csvs"&gt;&lt;code&gt;&lt;span class="n"&gt;catalog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;reports&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the user expands the final collapsed group, the cookie is no longer needed and is deleted.&lt;/p&gt;

&lt;p&gt;If several independent admin interfaces are hosted on the same domain, each one can use its own namespace:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ADMIN_COLLAPSE_APPS_COOKIE_NAMESPACE = "backoffice"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This prevents the menu state from one admin interface from being accidentally applied to another.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Working with Django Admin search&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The standard Django Admin sidebar includes a search field for filtering applications and models.&lt;/p&gt;

&lt;p&gt;This created a less obvious edge case: what should happen when a matching model belongs to a collapsed application group?&lt;/p&gt;

&lt;p&gt;Without additional handling, Django would find the model, but the user would not see it because its group would still be collapsed. To avoid this, matching application groups are temporarily expanded while the search field contains text.&lt;/p&gt;

&lt;p&gt;When the search field is cleared, the interface returns to the state selected by the user before the search started. Searching does not overwrite the saved collapse state or permanently expand any applications.&lt;/p&gt;

&lt;p&gt;It is a small detail, but without it the collapse feature would conflict with one of the useful built-in Django Admin tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why I did not completely replace the navigation template&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The most direct way to implement this feature would be to copy the standard Django Admin navigation template and modify it.&lt;/p&gt;

&lt;p&gt;That approach works, but it leaves the project with its own copy of a relatively large Django template. After every Django update, the copied template has to be compared with the new standard version.&lt;/p&gt;

&lt;p&gt;Django may add markup changes, accessibility improvements, or new features that do not automatically appear in the copied template.&lt;/p&gt;

&lt;p&gt;For this reason, the package tries to interfere with the standard admin as little as possible. Django still generates the applications, models, links, ordering, and permissions. The package’s JavaScript only finds the existing groups in the DOM and adds collapse buttons.&lt;/p&gt;

&lt;p&gt;This approach still depends on the structure of the standard Django Admin, but the amount of overridden behavior is much smaller than it would be with a complete template replacement.&lt;/p&gt;

&lt;p&gt;If the expected markup is not present on a page, the script simply stops. The admin remains available and continues working without the collapse feature.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The admin should still work without JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The feature is implemented as progressive enhancement. JavaScript improves the interface, but it is not required to access administrative sections.&lt;/p&gt;

&lt;p&gt;If the script fails to load, is blocked, or JavaScript is disabled in the browser, every application group remains expanded. Links to models continue working, and the user does not lose access to any admin functionality.&lt;/p&gt;

&lt;p&gt;In the worst case, Django Admin simply returns to its normal default behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessibility&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The toggles are implemented as real  elements rather than clickable div or span elements. This makes them keyboard accessible and allows them to receive focus correctly.&lt;/p&gt;


&lt;p&gt;When the state changes, the package updates the aria-expanded attribute. Each button is also connected to its model list through aria-controls.&lt;/p&gt;

&lt;p&gt;The styles take the prefers-reduced-motion setting and forced-colors mode into account. This does not replace a full accessibility audit of Django Admin, but it helps ensure that the package does not make the standard interface less accessible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Customizing the arrows and appearance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By default, the package uses simple Unicode symbols: a downward arrow for an expanded group and a right-pointing arrow for a collapsed group.&lt;/p&gt;

&lt;p&gt;This avoids adding an icon library, SVG sprite, or any external dependency. The symbols can still be replaced through CSS variables:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;:root {&lt;br&gt;
    --django-admin-collapse-apps-toggle-expanded-symbol: "▼";&lt;br&gt;
    --django-admin-collapse-apps-toggle-collapsed-symbol: "▶";&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;CSS can also be used to change the button color, symbol size, spacing, and focus styling.&lt;/p&gt;

&lt;p&gt;The package uses colors from the standard Django Admin interface and works with both its light and dark modes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What the package deliberately does not do&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;django-admin-collapse-apps is intentionally a small enhancement. It does not replace Django Admin with a custom theme, rebuild the menu, reorder models, add a separate user settings system, or store preferences in the database.&lt;/p&gt;

&lt;p&gt;It does not use jQuery, third-party JavaScript libraries, a CDN, or external resources. The entire feature is implemented with a small amount of JavaScript and CSS.&lt;/p&gt;

&lt;p&gt;This also defines the main limitation of the package: it is designed primarily for the standard Django Admin interface. Themes that completely replace the sidebar may use different markup and usually provide their own navigation features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why publish a package for one small feature?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Collapsible application groups can be implemented directly inside a single project. Installing another dependency is not strictly necessary.&lt;/p&gt;

&lt;p&gt;However, when the same improvement is needed in several projects, it becomes necessary to copy templates, JavaScript, styles, cookie settings, and fixes for various edge cases.&lt;/p&gt;

&lt;p&gt;At that point, maintaining one small package is easier than maintaining several slightly different local implementations.&lt;/p&gt;

&lt;p&gt;Publishing the feature as a separate project also encourages more careful work on compatibility, documentation, tests, and behavior across different Django versions.&lt;/p&gt;

&lt;p&gt;The result is a small package without any attempt to become a new admin platform. It does one thing: it allows users to hide application groups they do not currently need.&lt;/p&gt;

&lt;p&gt;The source code is available on GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kroxiksut/django-admin-collapse-apps" rel="noopener noreferrer"&gt;https://github.com/kroxiksut/django-admin-collapse-apps&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The package is available on PyPI:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/django-admin-collapse-apps/" rel="noopener noreferrer"&gt;https://pypi.org/project/django-admin-collapse-apps/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback is welcome, especially from developers using the package in large projects with heavily extended Django Admin interfaces. If you find a bug or an unusual edge case, feel free to open an issue on GitHub.&lt;/p&gt;


</description>
      <category>webdev</category>
      <category>django</category>
      <category>python</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
