Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shire FileEditorProvider #178

Closed
phodal opened this issue Jan 2, 2025 · 2 comments
Closed

Shire FileEditorProvider #178

phodal opened this issue Jan 2, 2025 · 2 comments

Comments

@phodal
Copy link
Owner

phodal commented Jan 2, 2025

简化后的需求描述:

Shire 插件的 FileEditorProvider 功能强大,但指令操作(如 /file 选择文件)增加了学习成本,初学者不易上手。我们希望通过可视化操作(如按钮、菜单)代替部分指令,降低初始使用门槛,让用户更快速地掌握常用功能。同时保留指令操作,方便高级用户使用。

翻译成英语:

Simplified Problem Description:

The FileEditorProvider feature of the Shire plugin is powerful, but command-based operations (such as /file for file selection) increase the learning curve, making it difficult for beginners to get started. We hope to replace some commands with visual operations (such as buttons and menus) to lower the initial barrier to entry and allow users to quickly grasp common functions. At the same time, keep the command-based operations for advanced users.

Issue Template (English Version):

Is your feature request related to a problem? Please describe.

The Shire plugin's FileEditorProvider feature, while powerful, has a steep learning curve due to its reliance on command-based operations (e.g., /file for selecting files). This makes it difficult for new users to quickly understand and utilize the plugin's capabilities, increasing the initial barrier to entry. Compared to Markdown, which primarily focuses on display, Shire involves logical operations, making its learning curve steeper.

Describe the solution you'd like

We propose the following improvements to reduce the learning curve and improve the user experience of Shire's FileEditorProvider:

  • Visual Operations: Replace common commands with visual elements in the editor, such as:
    • Adding shortcut buttons to the editor's sidebar or toolbar for common commands like file selection, saving, formatting, etc.
    • Using a graphical user interface (GUI) for certain operations, such as a file browser window for file selection.
    • Providing context menus within the editor, offering relevant Shire functions based on the current content.
    • Variable Debugger
  • Command Hints and Autocompletion: Provide intelligent suggestions and autocompletion for commands, reducing the need for users to memorize them and improving input efficiency.
  • Flowchart/Annotations: If possible, visualize the plugin's workflow with a flowchart, adding annotations to each step to explain its function. For example, illustrate the execution process of the /file command, including file selection and loading steps.
  • Graded Guidance: Offer tiered guidance for users with different levels of familiarity. Novice users can quickly get started with common functions through visual operations, while advanced users can still use commands for more flexible control.

These improvements aim to lower the initial learning curve of Shire's FileEditorProvider, making it more accessible and user-friendly.

Describe alternatives you've considered

We considered alternatives such as:

  • More detailed documentation and tutorials: While helpful, these don't fundamentally address the high learning curve. Visual operations and intelligent prompts provide more direct guidance.
  • Simplifying command syntax: This could slightly reduce the learning curve, but users would still need to memorize and type commands. Visual operations are more intuitive and easier to use.

Additional context

The example of "/file meaning select file" highlights the issue. Providing a button or menu item for file selection would eliminate the need to memorize and type the command. The distinction between Markdown's display-focused nature and Shire's logical operations underscores the need for improved user experience. Providing flowcharts or annotations would help users understand the plugin's inner workings.

This simplified version focuses on the core issue and proposed solutions, making it easier to understand and implement. The English translation is provided for broader communication.

@phodal
Copy link
Owner Author

phodal commented Jan 2, 2025

phodal added a commit that referenced this issue Jan 3, 2025
Introduce a new `ShireFileEditorProvider` class to handle custom file editing for Shire files. This includes creating a dedicated editor with a toolbar and a "Run Shire" action. The provider is registered in the plugin's XML configuration.
phodal added a commit that referenced this issue Jan 4, 2025
Remove custom foreground, background, and border styling for the label, keeping only the empty border with horizontal padding. This simplifies the UI and aligns with a cleaner design approach.
phodal added a commit that referenced this issue Jan 4, 2025
- Expose `createCodeViewerEditor` as a public function.
- Add `sampleEditor` parameter to `ShireRunner` methods to allow custom editor usage.
- Update `ShirePreviewEditor` to include a sample editor for variable testing.
phodal added a commit that referenced this issue Jan 4, 2025
Update the label format for the sample file in the ShirePreviewEditor to include parentheses around the file name.
phodal added a commit that referenced this issue Jan 4, 2025
#178

- Set background color for ShireVariablePanel to white.
- Refactor CUrlHttpHandler to use ApplicationManager for async request handling.
- Update ShireEnvReader to use DumbService for safe index access in smart mode.
- Modify ShirePreviewEditor to refresh output after index is ready.
phodal added a commit that referenced this issue Jan 4, 2025
- Set background color for table model in ShireVariablePanel.
- Update font, background, and styling for labels in ShirePreviewEditor.
- Add new labels for "Variables" and
phodal added a commit that referenced this issue Jan 4, 2025
Add a missing row in the editor layout to properly initialize the code highlight sketch.
@phodal
Copy link
Owner Author

phodal commented Jan 4, 2025

Current Design

image

phodal added a commit that referenced this issue Jan 5, 2025
- Rename method `updateOutput` to `updateDisplayedContent` for clarity.
- Add rounded border and scroll bar settings to the preview editor.
- Enable line numbers and soft wraps in the editor settings.
phodal added a commit that referenced this issue Jan 5, 2025
…tor #178

- Move language initialization to a class-level variable.
- Replace direct usage of `javaLanguage` with the class-level `language` variable.
- Remove redundant comments and simplify code flow.
phodal added a commit that referenced this issue Jan 5, 2025
…ne handling #178

- Wrap file operations in `runReadAction` to ensure thread safety.
- Replace `runBlocking` with coroutine `launch` for better async handling.
- Add `createEditorAsync` method for async editor creation.
- Update UI labels and improve code readability.
phodal added a commit that referenced this issue Jan 5, 2025
- Move editorLineThreshold to constructor in EditorFragment and CodeHighlightSketch.
- Update ShirePreviewEditor to use a custom threshold value.
- Remove redundant editor scroll bar settings and simplify updateDisplayedContent logic.
phodal added a commit that referenced this issue Jan 5, 2025
…lateCompiler

#178

Renamed `ShireTemplateCompiler` to `ShireVariableTemplateCompiler` to better reflect its purpose. Updated all references and imports across the codebase to match
phodal added a commit that referenced this issue Jan 5, 2025
…178

Introduce ResolvableVariableSnapshot to store variable change flow during compilation. Includes a manager class for handling snapshots.
@phodal phodal closed this as completed Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant