WebExpress 0.0.10-alpha – An Intelligent Prompt Control for Complex WQL Queries

The development of our new WQL prompt control began with the ambition to make the input of complex filter expressions as direct and efficient as working in a terminal. The goal was to create an input environment that feels familiar, responds quickly, and at the same time respects the specifics of WQL syntax. This includes a suggestion system that offers matching attributes, operators, and values while typing, displaying them clearly in the hint area below the input field. The most likely continuation appears as plain text, complemented by a list of alternative values, limited to a maximum entries for clarity. Suggestions can be navigated using the arrow keys, while the Tab key can be used to accept a selected completion.

To ensure that suggestions remain up to date and performant, they are provided through a REST interface that adheres to the defined WQL syntax. To avoid unnecessary network load, requests are triggered only after a short input delay. This debouncing prevents a request from being sent on every single keystroke. Additionally, suggestions are cached on the client based on prefixes, allowing known input states to be served without another server request. Only when a prefix is not present in the cache or the cache has expired is a new request sent to the API.

A key aspect of the control is the ability to work at arbitrary cursor positions. Users can write not only at the end of the expression but also make changes in the middle of the text, replace operators, or correct values. For more extensive expressions, the input field supports multiple lines. Pressing Ctrl+Enter inserts a new line without submitting the expression. Only Enter triggers submission, after which the REST API validates the expression on the server side. Only valid expressions are accepted and added to the history.

The history function is also modeled after shell behavior. Previously submitted WQL expressions are stored on the server and can be recalled using Page Up and Page Down. Page Up loads the previous entry, Page Down the next one. If the user navigates back to the original starting position, the previously typed but not yet submitted input is automatically restored. This preserves the writing flow and allows quick switching between earlier queries without losing the current state.

The WQL language itself follows a clearly structured pattern of attribute, operator, and value. Values can be simple strings, numbers, function calls, or lists, and can be extended with fuzzy or distance modifiers. Logical operators such as “and” or “or” allow multiple expressions to be combined and nested to arbitrary depth. Order clauses and partitioning operators like “take” and “skip” provide additional control over the result set. Examples such as name = "Alpha", type in ("Project","Document","Event"), status = "active" order by created desc, or more complex constructs involving functions, fuzzy matching, and nested conditions demonstrate the expressiveness of the language and highlight why an intelligent input field is so valuable.

In addition to the developed prompt control, we also considered a classic form based editor as a possible alternative, where attributes, operators, and values are selected via dropdowns. This variant is particularly suitable for users who prefer structured selection over free form typing. Unlike other discarded approaches, this form editor is not intended to replace the prompt control but to be implemented as its own complementary control. It offers a guided and visually well defined way to construct WQL expressions without having to write the syntax manually. Both controls, the text based prompt control and the form based editor, are intended to complement each other and support different working styles, depending on whether one prefers typing quickly or clicking and selecting.

Another alternative would have been a graphical query builder with blocks or nodes, similar to what is known from visual workflow tools. However, such systems are often cumbersome, require a lot of space, and are only partially suitable for compact and text based filter languages like WQL. A pure code editor with syntax highlighting and static autocompletion was also considered, but it would not have provided the dynamic context sensitivity or interactivity that is essential for WQL. Compared to these options, the developed prompt control offers the best balance of flexibility, speed, and precision.

Finally, we invite everyone interested to participate in the ongoing development. Whether feedback on usability, ideas for new features, suggestions for improving syntax support, or contributions to the documentation, any form of involvement is welcome. The development of the WQL prompt control is an ongoing process, and we appreciate every perspective that helps make the tool even better.

Comments

Popular posts from this blog

WebExpress 0.0.10-alpha – A Step Back for Reflection

WebExpress 0.0.8-alpha – Completion of the Development Guide for WebExpress

WebExpress 0.0.10-alpha – The REST APIs as the Foundation of the Table Architecture