oss-slu / esp

MIT License
0 stars 5 forks source link

Change download flow and the output file name #104

Open SiriChandanaGarimella opened 2 weeks ago

SiriChandanaGarimella commented 2 weeks ago

Is your feature request related to a problem? Please describe. Currently, the download functionality uses a generic button labeled "Download Output" which doesn't align with modern UI patterns. Additionally, the downloaded files use generic names, making it difficult for users to organize and identify files when downloading multiple documents with different search terms.

Describe the solution you'd like

  1. Replace the "Download Output" button with a download icon:

    • Use a standard download icon (downward arrow)
    • Maintain the current blue color scheme (#4169E1)
    • Include a hover tooltip for accessibility
  2. Implement descriptive filename convention:

    • Format: {date}_ {inputfilename} {search_term}.docx

    • Date format: YYYYMMDD

    • Maximum filename length: 100 characters

    • Component limits:

      • Input filename: truncate to 40 chars if longer
      • Search term: truncate to 40 chars if longer
      • Add ellipsis (...) when truncating
    • Example: When searching for "CARTESIAN COORDINATES" in "Styrene-H.txt", the output should be "20241116_Styrene-H_CARTESIAN-COORDINATES.docx"

  3. Add it in the Preview modal as well

  4. In case of failure, display an error message returned by the API

Acceptance Criteria

  1. Download icon implemented with the current blue color scheme in Home page and Preview modal
  2. Hover tooltip added showing "Download"
  3. Downloaded files follow the naming convention: {YYYYMMDD}_{inputfilename}{search_term}.docx
  4. Implement filename length restrictions:
    • Total length ≤ 100 characters
    • Input filename truncated to 40 chars if longer
    • Search term truncated to 40 chars if longer
  5. Download functionality remains unchanged
  6. In case of failure, display an error message returned by. the API