Christos Malliaridis created SOLR-17911:
-------------------------------------------
Summary: Implement File Content Viewer Component
Key: SOLR-17911
URL: https://issues.apache.org/jira/browse/SOLR-17911
Project: Solr
Issue Type: Sub-task
Components: Admin UI
Reporter: Christos Malliaridis
In the new UI we want to view the content of files (and later edit it) in a
format that is similar to the experience of IDEs. These file previews are
currently used in the [Cluster -> Zookeeper
section|https://www.figma.com/design/VdbEfcWQ8mirFNquBzbPk2/Apache-Solr-Admin-UI-v2-Concept?node-id=319-20114&t=yxFihPpG3r7FXACm-1]
and the [Configsets ->
Files|https://www.figma.com/design/VdbEfcWQ8mirFNquBzbPk2/Apache-Solr-Admin-UI-v2-Concept?node-id=227-7661&t=yxFihPpG3r7FXACm-1].
h2. Task
Implement a file content viewer component that displays the content of a file.
h2. Acceptance Criteria
- The text input may be a simple string for now (not a file)
- You may write the component in a way that wil later be extendible to a code
editor (e.g. with an {{editable: Boolean}} parameter)
- The lines are numerated
- User can select parts of the file content (e.g. for copy-pasting)
- Line breaks are respected
- Escaped characters are respected
- Horizontal and vertical scrolling is supported when the content exceeds the
width or height
Syntax highlighting and editing file content is out of this ticket's scope. You
may however take into account that this component will likely be updated later
(separate ticket) to allow file editing. Any actions / outputs of editing or
saving changes can be ignored for now.
You should also ignore any potential displaying options like changing the
wrapping of the lines that exceed the available width or increasing the font
size. These features would overcomplicate the initial PR and may be added in a
later state after implementation details are clarified and defined.
h2. Additional Information
You do not have to cover large files with buffered readers, as it is likely not
supported by our API. So loading and "rendering" the entire file is fine. You
may however consider lazily loading lines that are not displayed, if that does
not cause additional complications later when we want to enable syntax
highlighting (different ticket).
The [code viewer of the Compose Multiplatform
examples|https://github.com/JetBrains/compose-multiplatform/tree/master/examples/codeviewer]
provides a solution for the [code viewer|] that may be a bit complicated, but
could be used for inspiration.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]