mirror of https://github.com/Wox-launcher/Wox
feat(instructions): add comprehensive project and coding standards documentation
* Removed outdated coding standards and guides. * Added new documentation for project structure, Flutter UI development, Python plugin development, and Go code standards. * Updated commit message instructions to follow Conventional Commits format.
This commit is contained in:
parent
1d02557b91
commit
67667ab8ef
|
@ -1,26 +0,0 @@
|
|||
---
|
||||
description: Wox Project Structure
|
||||
globs:
|
||||
alwaysApply: false
|
||||
---
|
||||
# Wox Project Structure
|
||||
|
||||
Wox is a cross-platform quick launcher application, consisting of the following main components:
|
||||
|
||||
## Core Components
|
||||
|
||||
- [wox.core](mdc:wox.core/main.go): Wox backend implemented in Go, communicating with the frontend via websocket and http
|
||||
- [wox.core/setting](mdc:wox.core/setting): Settings-related definitions
|
||||
- [wox.core/plugin](mdc:wox.core/plugin): Plugin API definitions and implementations
|
||||
|
||||
## Plugin System
|
||||
|
||||
- [wox.plugin.python](mdc:wox.plugin.python/src/wox_plugin/__init__.py): Library required for Python plugins
|
||||
- [wox.plugin.host.python](mdc:): Host for Python plugins, communicating with wox.core via websocket, responsible for loading Python plugins
|
||||
- [wox.plugin.nodejs](mdc:): Library required for NodeJS plugins
|
||||
- [wox.plugin.host.nodejs](mdc:): Host for NodeJS plugins, communicating with wox.core via websocket, responsible for loading NodeJS plugins
|
||||
|
||||
## Frontend Interface
|
||||
|
||||
- [wox.ui.flutter](mdc:wox/wox/wox.ui.flutter/lib/main.dart): Wox frontend implemented in Flutter, communicating with wox.core via websocket
|
||||
|
|
@ -1,8 +1,29 @@
|
|||
---
|
||||
description:
|
||||
globs:
|
||||
alwaysApply: true
|
||||
applyTo: '**'
|
||||
---
|
||||
|
||||
# Wox Project Structure
|
||||
|
||||
Wox is a cross-platform quick launcher application, consisting of the following main components:
|
||||
|
||||
## Core Components
|
||||
|
||||
- [wox.core](mdc:wox.core/main.go): Wox backend implemented in Go, communicating with the frontend via websocket and http
|
||||
- [wox.core/setting](mdc:wox.core/setting): Settings-related definitions
|
||||
- [wox.core/plugin](mdc:wox.core/plugin): Plugin API definitions and implementations
|
||||
|
||||
## Plugin System
|
||||
|
||||
- [wox.plugin.python](mdc:wox.plugin.python/src/wox_plugin/__init__.py): Library required for Python plugins
|
||||
- [wox.plugin.host.python](mdc:): Host for Python plugins, communicating with wox.core via websocket, responsible for loading Python plugins
|
||||
- [wox.plugin.nodejs](mdc:): Library required for NodeJS plugins
|
||||
- [wox.plugin.host.nodejs](mdc:): Host for NodeJS plugins, communicating with wox.core via websocket, responsible for loading NodeJS plugins
|
||||
|
||||
## Frontend Interface
|
||||
|
||||
- [wox.ui.flutter](mdc:wox/wox/wox.ui.flutter/lib/main.dart): Wox frontend implemented in Flutter, communicating with wox.core via websocket
|
||||
|
||||
|
||||
# Wox Project General Coding Standards
|
||||
|
||||
## General Guidelines
|
|
@ -0,0 +1,16 @@
|
|||
Follow the Conventional Commits format strictly for commit messages. Use the structure below:
|
||||
|
||||
```
|
||||
<type>[scope]: <description>
|
||||
|
||||
[optional body]
|
||||
```
|
||||
|
||||
Guidelines:
|
||||
- **Language**: Use english
|
||||
- **Type and Scope**: Choose an appropriate type (e.g., `feat`, `fix`, `refactor`, `test`) and scope to describe the affected module or feature (e.g., `ui`, `ai`, `windows`, `macos`) .
|
||||
- **Description**: Write a concise, informative description in the header; use backticks if referencing code or specific terms.
|
||||
- **Body**: For additional details, use a well-structured body section:
|
||||
- Use bullet points (`*`) for clarity.
|
||||
- Clearly describe the motivation, context, or technical details behind the change, if applicable.
|
||||
- Commit messages should be clear, informative, and professional, aiding readability and project tracking.
|
|
@ -1,8 +1,7 @@
|
|||
---
|
||||
description:
|
||||
globs: *.dart
|
||||
alwaysApply: false
|
||||
applyTo: '**/*.dart'
|
||||
---
|
||||
|
||||
# Wox Flutter UI Development Guide
|
||||
|
||||
## Directory Structure
|
|
@ -1,8 +1,7 @@
|
|||
---
|
||||
description:
|
||||
globs: *.py
|
||||
alwaysApply: false
|
||||
applyTo: '**/*.py'
|
||||
---
|
||||
|
||||
# Wox Python Plugin Development Guide
|
||||
|
||||
## Basic Standards
|
|
@ -1,8 +1,7 @@
|
|||
---
|
||||
description:
|
||||
globs: *.go
|
||||
alwaysApply: false
|
||||
applyTo: '**/*.go'
|
||||
---
|
||||
|
||||
# wox.core Go Code Standards
|
||||
|
||||
## General Guidelines
|
|
@ -31,7 +31,11 @@
|
|||
],
|
||||
"settings": {
|
||||
"python.languageServer": "Default",
|
||||
"makefile.configureOnOpen": false
|
||||
"github.copilot.chat.commitMessageGeneration.instructions": [
|
||||
{
|
||||
"file": ".github/instructions/commit-message-instructions.md"
|
||||
}
|
||||
]
|
||||
},
|
||||
"extensions": {
|
||||
"recommendations": [
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:wox/components/wox_drag_move_view.dart';
|
||||
|
||||
/// A component that adds border drag functionality around the interface
|
||||
/// Allows window dragging from top, bottom, left, and right borders
|
||||
class WoxBorderDragMoveArea extends StatelessWidget {
|
||||
const WoxBorderDragMoveArea({
|
||||
super.key,
|
||||
required this.child,
|
||||
this.onDragEnd,
|
||||
this.borderWidth = 5.0,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
final VoidCallback? onDragEnd;
|
||||
final double borderWidth;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
// Center content
|
||||
Positioned.fill(child: child),
|
||||
|
||||
// Top drag area
|
||||
Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
height: borderWidth,
|
||||
child: WoxDragMoveArea(
|
||||
onDragEnd: onDragEnd,
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Bottom drag area
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
height: borderWidth,
|
||||
child: WoxDragMoveArea(
|
||||
onDragEnd: onDragEnd,
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Left drag area
|
||||
Positioned(
|
||||
top: borderWidth,
|
||||
bottom: borderWidth,
|
||||
left: 0,
|
||||
width: borderWidth,
|
||||
child: WoxDragMoveArea(
|
||||
onDragEnd: onDragEnd,
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Right drag area
|
||||
Positioned(
|
||||
top: borderWidth,
|
||||
bottom: borderWidth,
|
||||
right: 0,
|
||||
width: borderWidth,
|
||||
child: WoxDragMoveArea(
|
||||
onDragEnd: onDragEnd,
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ import 'package:desktop_drop/desktop_drop.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:from_css_color/from_css_color.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:wox/components/wox_border_drag_move_view.dart';
|
||||
import 'package:wox/controllers/wox_launcher_controller.dart';
|
||||
import 'package:wox/modules/launcher/views/wox_query_box_view.dart';
|
||||
import 'package:wox/modules/launcher/views/wox_query_result_view.dart';
|
||||
|
@ -20,32 +21,38 @@ class WoxLauncherView extends GetView<WoxLauncherController> {
|
|||
onDragDone: (DropDoneDetails details) {
|
||||
controller.handleDropFiles(details);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: WoxThemeUtil.instance.currentTheme.value.appPaddingTop.toDouble(),
|
||||
right: WoxThemeUtil.instance.currentTheme.value.appPaddingRight.toDouble(),
|
||||
bottom: controller.isToolbarShowedWithoutResults
|
||||
? 0
|
||||
: WoxThemeUtil.instance.currentTheme.value.appPaddingBottom.toDouble(), //WoxThemeUtil.instance.currentTheme.value.appPaddingBottom.toDouble(),
|
||||
left: WoxThemeUtil.instance.currentTheme.value.appPaddingLeft.toDouble(),
|
||||
),
|
||||
child: const Column(
|
||||
children: [
|
||||
WoxQueryBoxView(),
|
||||
Expanded(child: WoxQueryResultView()),
|
||||
],
|
||||
child: WoxBorderDragMoveArea(
|
||||
borderWidth: WoxThemeUtil.instance.currentTheme.value.appPaddingTop.toDouble(),
|
||||
onDragEnd: () {
|
||||
controller.focusQueryBox(selectAll: false);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: WoxThemeUtil.instance.currentTheme.value.appPaddingTop.toDouble(),
|
||||
right: WoxThemeUtil.instance.currentTheme.value.appPaddingRight.toDouble(),
|
||||
bottom: controller.isToolbarShowedWithoutResults
|
||||
? 0
|
||||
: WoxThemeUtil.instance.currentTheme.value.appPaddingBottom.toDouble(), //WoxThemeUtil.instance.currentTheme.value.appPaddingBottom.toDouble(),
|
||||
left: WoxThemeUtil.instance.currentTheme.value.appPaddingLeft.toDouble(),
|
||||
),
|
||||
child: const Column(
|
||||
children: [
|
||||
WoxQueryBoxView(),
|
||||
Expanded(child: WoxQueryResultView()),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (controller.isShowToolbar)
|
||||
const SizedBox(
|
||||
height: 40,
|
||||
child: WoxQueryToolbarView(),
|
||||
),
|
||||
],
|
||||
if (controller.isShowToolbar)
|
||||
const SizedBox(
|
||||
height: 40,
|
||||
child: WoxQueryToolbarView(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue