[PR #311] feat: Add editor indentation setting #233

Open
opened 2025-12-29 07:19:59 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mountain-loop/yaak/pull/311
Author: @G0STG0D
Created: 11/27/2025
Status: 🔄 Open

Base: mainHead: main


📝 Commits (7)

  • dca19d0 Add editor_indentation column to settings table
  • 1bb86f3 Implemented editor indentation to the Editor
  • 454c4bf Enhanced "Reformat contents"-Button to support customizable indentation
  • 91138a9 Refactored code for consistent formatting and indentation
  • 9393e22 Incorporated editor indentation setting into text formatting query
  • 38cfeb3 Refactored formatting functions for indentation to use single source of truth
  • 167d852 Merge branch 'main' into main

📊 Changes

11 files changed (+86 additions, -72 deletions)

View changed files

📝 package-lock.json (+30 -57)
📝 src-tauri/src/lib.rs (+4 -2)
📝 src-tauri/yaak-models/bindings/gen_models.ts (+1 -1)
src-tauri/yaak-models/migrations/20251127214940_add-editor-tab-indentation.sql (+1 -0)
📝 src-tauri/yaak-models/src/models.rs (+4 -0)
📝 src-tauri/yaak-models/src/queries/settings.rs (+1 -0)
📝 src-tauri/yaak-templates/pkg/yaak_templates_bg.wasm (+0 -0)
📝 src-web/components/Settings/SettingsInterface.tsx (+14 -0)
📝 src-web/components/core/Editor/Editor.tsx (+16 -7)
📝 src-web/hooks/useFormatText.ts (+5 -1)
📝 src-web/lib/formatters.ts (+10 -4)

📄 Description

Problem

Users could not change the editor indentation size, which was fixed at 2 spaces. Many users prefer 4 spaces or other tab sizes for readability and consistency with their coding standards, making it frustrating for them to work efficiently.

Solution

Added support for configurable editor indentation, allowing users to set their preferred number of spaces per tab. This ensures that the editor respects individual coding styles and improves the overall user experience.

Preview

SCR-20251127-txrw SCR-20251127-txuw SCR-20251127-tyam

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mountain-loop/yaak/pull/311 **Author:** [@G0STG0D](https://github.com/G0STG0D) **Created:** 11/27/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (7) - [`dca19d0`](https://github.com/mountain-loop/yaak/commit/dca19d0ab8a2a0f2be6024494dc0195567f80914) Add editor_indentation column to settings table - [`1bb86f3`](https://github.com/mountain-loop/yaak/commit/1bb86f39692ccc21729a1198ef6037eb0d212bbc) Implemented editor indentation to the Editor - [`454c4bf`](https://github.com/mountain-loop/yaak/commit/454c4bf87f5c03b8e6ec2dd9490616b413fcd2c0) Enhanced "Reformat contents"-Button to support customizable indentation - [`91138a9`](https://github.com/mountain-loop/yaak/commit/91138a9ea4f978958b57b88b4d5b93c01dfae495) Refactored code for consistent formatting and indentation - [`9393e22`](https://github.com/mountain-loop/yaak/commit/9393e2245d2496a7dc034d2da9fcf19f54037673) Incorporated editor indentation setting into text formatting query - [`38cfeb3`](https://github.com/mountain-loop/yaak/commit/38cfeb37bb4f65f4e69d3e1a7184167202293251) Refactored formatting functions for indentation to use single source of truth - [`167d852`](https://github.com/mountain-loop/yaak/commit/167d852614e9da9a0a022ae3a79ad2bf8ed4b387) Merge branch 'main' into main ### 📊 Changes **11 files changed** (+86 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+30 -57) 📝 `src-tauri/src/lib.rs` (+4 -2) 📝 `src-tauri/yaak-models/bindings/gen_models.ts` (+1 -1) ➕ `src-tauri/yaak-models/migrations/20251127214940_add-editor-tab-indentation.sql` (+1 -0) 📝 `src-tauri/yaak-models/src/models.rs` (+4 -0) 📝 `src-tauri/yaak-models/src/queries/settings.rs` (+1 -0) 📝 `src-tauri/yaak-templates/pkg/yaak_templates_bg.wasm` (+0 -0) 📝 `src-web/components/Settings/SettingsInterface.tsx` (+14 -0) 📝 `src-web/components/core/Editor/Editor.tsx` (+16 -7) 📝 `src-web/hooks/useFormatText.ts` (+5 -1) 📝 `src-web/lib/formatters.ts` (+10 -4) </details> ### 📄 Description ## Problem Users could not change the editor indentation size, which was fixed at 2 spaces. Many users prefer 4 spaces or other tab sizes for readability and consistency with their coding standards, making it frustrating for them to work efficiently. ## Solution Added support for configurable editor indentation, allowing users to set their preferred number of spaces per tab. This ensures that the editor respects individual coding styles and improves the overall user experience. ## Preview <img width="743" height="396" alt="SCR-20251127-txrw" src="https://github.com/user-attachments/assets/15a6b840-e659-400e-bd06-58c7e811b36f" /> <img width="575" height="163" alt="SCR-20251127-txuw" src="https://github.com/user-attachments/assets/818fd33c-bb61-40e3-9490-27bdb00088d3" /> <img width="405" height="164" alt="SCR-20251127-tyam" src="https://github.com/user-attachments/assets/4802f3c4-a03f-4676-b92d-48b5865291b0" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 07:19:59 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/yaak#233